|
Home > Archive > Macromedia Flash Server > October 2005 > flash contact form with amfphp
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
flash contact form with amfphp
|
|
| bonedog 2005-10-08, 5:45 pm |
| Hello, can somebody please help me with this , I have searched on the =
net for days but can't find the answer
I'm making a flash contact form on my site with amfphp and I send the =
vars in a loadvarsobject to php:
sendContactForm =3D function(_contactObj) {
this.createNetconnection();
var contactResponder =3D new Object();
contactResponder.objRef =3D this;
contactResponder.onResult =3D function(result) {
this.objRef.broadcastMessage("_sendContactFormResult", result);
};
this.connection.call("Project.sendContactForm", contactResponder, =
_contactObj);
};
The problem is I don't seem to be able to acces the vars in PHP.
This is what I have in PHP:=20
function sendContactForm($email, $message, $topic)=20
{
$email =3D $_POST["email"];
$message =3D $_POST["message"];
$topic =3D $_POST["topic"];
$to =3D "info-1glJUdMhXo/bB1ukUYwELw@public.gmane.org"; =20
$subject =3D"Contact form request from myaddress.be";
if( mail($to, $subject,$message))
return "0k";=20
else return "Error";=20
=20
}
This is what I get in the NetConnection Debugger:
Call-Project.sendContactForm({message:hello, subject:testing, =
email:info-xK4yqaRgwpk@public.gmane.org, topic:request information})
MethodName: "Project.sendContactForm"
Parameters (object #2)
......[0] (object #3)
...........email: "info-xK4yqaRgwpk@public.gmane.org"
...........message: "hello"
...........subject: "testing"
...........topic: "request information"
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
| |
| lti-1a8g-LMbKfuCQv7pBDgjK7y7TUQ@public.gmane.o 2005-10-08, 5:45 pm |
| Hello,
Have you tried a "var_dump($email);" in your php function ?
It might give you a hint on the problem ...
Regards.
bonedog wrote:
>Hello, can somebody please help me with this , I have searched on the net for days but can't find the answer
>
>I'm making a flash contact form on my site with amfphp and I send the vars in a loadvarsobject to php:
>
>sendContactForm = function(_contactObj) {
> this.createNetconnection();
> var contactResponder = new Object();
> contactResponder.objRef = this;
> contactResponder.onResult = function(result) {
> this.objRef.broadcastMessage("_sendContactFormResult", result);
> };
> this.connection.call("Project.sendContactForm", contactResponder, _contactObj);
>};
>
>The problem is I don't seem to be able to acces the vars in PHP.
>
>This is what I have in PHP:
>
>function sendContactForm($email, $message, $topic)
> {
> $email = $_POST["email"];
> $message = $_POST["message"];
> $topic = $_POST["topic"];
> $to = "info-1glJUdMhXo/bB1ukUYwELw@public.gmane.org";
> $subject ="Contact form request from myaddress.be";
> if( mail($to, $subject,$message))
> return "0k";
> else return "Error";
>
>}
>
>This is what I get in the NetConnection Debugger:
>
>Call-Project.sendContactForm({message:hello, subject:testing, email:info-xK4yqaRgwpk@public.gmane.org, topic:request information})
>
>MethodName: "Project.sendContactForm"
>Parameters (object #2)
>.....[0] (object #3)
>..........email: "info-xK4yqaRgwpk@public.gmane.org"
>..........message: "hello"
>..........subject: "testing"
>..........topic: "request information"
>
>=---------------------------------------------------------
>Supported by Fig Leaf Software - http://www.figleaf.com
>=---------------------------------------------------------
>
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
| |
| lti-1a8g-LMbKfuCQv7pBDgjK7y7TUQ@public.gmane.o 2005-10-08, 5:45 pm |
| To be a bit clearer ...
And of course *before* your " $email = $_POST["email"];
The point is that if you think the elements you send from Flash are
available as parameters of your php function, there is no need to get
the values from the $_POST superglobal array.
Actually, you might just lose the correct values you had before the $var
= $_POST["var"] ...
Hope it will help a bit.
lti-1a8g-LMbKfuCQv7pBDgjK7y7TUQ@public.gmane.org wrote:
> Hello,
>
> Have you tried a "var_dump($email);" in your php function ?
> It might give you a hint on the problem ...
>
> Regards.
>
> bonedog wrote:
>
>
>
> =-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =-----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
| |
| Scott Mathieson 2005-10-08, 5:45 pm |
| You shouldn't be trying to access your arguments via the $_POST array - just
do it as in a normal method call
i.e
$email = $_POST["email"];
Is just
$email = $email;
Or just $email :P
You also shouldn't be sending the args as a loadvars object, just do a
direct method call - which is the whole idea of remoting in the first
place...
hth
-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of
lti-1a8g-LMbKfuCQv7pBDgjK7y7TUQ@public.gmane.org
Sent: 08 October 2005 20:11
To: FlashComm Mailing List
Subject: Re: [FlashComm] flash contact form with amfphp
Hello,
Have you tried a "var_dump($email);" in your php function ?
It might give you a hint on the problem ...
Regards.
bonedog wrote:
>Hello, can somebody please help me with this , I have searched on the
>net for days but can't find the answer
>
>I'm making a flash contact form on my site with amfphp and I send the vars
in a loadvarsobject to php:
>
>sendContactForm = function(_contactObj) {
> this.createNetconnection();
> var contactResponder = new Object();
> contactResponder.objRef = this;
> contactResponder.onResult = function(result) {
> this.objRef.broadcastMessage("_sendContactFormResult", result);
> };
> this.connection.call("Project.sendContactForm", contactResponder,
>_contactObj); };
>
>The problem is I don't seem to be able to acces the vars in PHP.
>
>This is what I have in PHP:
>
>function sendContactForm($email, $message, $topic)
> {
> $email = $_POST["email"];
> $message = $_POST["message"];
> $topic = $_POST["topic"];
> $to = "info-1glJUdMhXo/bB1ukUYwELw@public.gmane.org";
> $subject ="Contact form request from myaddress.be";
> if( mail($to, $subject,$message))
> return "0k";
> else return "Error";
>
>}
>
>This is what I get in the NetConnection Debugger:
>
>Call-Project.sendContactForm({message:hello, subject:testing,
>email:info-xK4yqaRgwpk@public.gmane.org, topic:request information})
>
>MethodName: "Project.sendContactForm"
>Parameters (object #2)
>.....[0] (object #3)
>..........email: "info-xK4yqaRgwpk@public.gmane.org"
>..........message: "hello"
>..........subject: "testing"
>..........topic: "request information"
>
>=---------------------------------------------------------
>Supported by Fig Leaf Software - http://www.figleaf.com
>=---------------------------------------------------------
>
>To change your subscription options or search the archive:
>http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>
>
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
|
|
|
|
|