loadVariablesNum and PHP5

  • Elye_Ball
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Aug 01, 2006
  • Posts: 6
  • Status: Offline

Post January 19th, 2007, 6:46 am

I have a flash form which has been working well...

Now my host has upgraded their server (from PHP4 to 5) and it doesn't work.

This is the line that used to work OK:
loadVariablesNum ("form_send.php", 0, "POST");

It works if I do this:
loadVariablesNum ("form_send.php?sName=" + sName + "&sContact=" + sContact + "&sComments=" + sComments , 0, "POST");

But I suspect that's not the best way to do it?!?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post January 19th, 2007, 6:46 am

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post January 21st, 2007, 10:53 pm

the second one in your example is a "GET", not a "POST" message.
If you want to send a "POST" message, use LoadVars class.
Code: [ Select ]
var lv:LoadVars = new LoadVars();
lv.sName = inputTextName.text; // here you change with the name that you have
lv.sContact = inputTextContact.text;
lv.sComments = inputTextComments.text;
lv.send("form_send.php");
  1. var lv:LoadVars = new LoadVars();
  2. lv.sName = inputTextName.text; // here you change with the name that you have
  3. lv.sContact = inputTextContact.text;
  4. lv.sComments = inputTextComments.text;
  5. lv.send("form_send.php");
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • Elye_Ball
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Aug 01, 2006
  • Posts: 6
  • Status: Offline

Post January 23rd, 2007, 8:15 am

Thanks. I appreciate the help. Unfortunately, it doesn't seem to work. Nothing comes through the other end unless I use the one where I specify the individual fields.

My PHP script is like this:

<?

$sName=$_GET["sName"];
$sContact=$_GET["sContact"];
$sComments=$_GET["sComments"];

$to .= "me@me.com";
$subject .= "My on-line contact form";

//Main body

$msg .= "Name: $sName\n\n";
$msg .= "E-mail address: $sContact\n\n";
$msg .= "Comments/message: $sComments\n\n";

mail($to, $subject, $msg, "From: USER\nReply-To: $sContact\n");
?>

I recently had to add the $_GET statements for it to work with PHP5?!?

I have googled... plenty of times... I couldn't find an answer hence the forum post.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post January 23rd, 2007, 10:20 pm

of course is not working since you use POST in flash and GET in php.
use instead of $_GET either $_POST or $_REQUEST, then it should work.
$_REQUEST recognize both GET and POST variables.
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 48 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.