loadVariablesNum and PHP5

  • Elye_Ball
  • Newbie
  • Newbie
  • Elye_Ball
  • Posts: 6

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

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");
  • Elye_Ball
  • Newbie
  • Newbie
  • Elye_Ball
  • Posts: 6

Post 3+ Months Ago

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
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

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.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 10 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.