Jump to content


query_string decoding and mail() function

  • Please log in to reply
1 reply to this topic

#1 jesse8771

  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 30 June 2006 - 07:13 PM

Hello all,
This is probably an easy fix but I am still relatively new to php...

I have a query string being sent over from Flash mx 2004 as follows:

(where capitalized words are the values of variables I have named the following: theName, theEmail, thePurpose, theMessage)

I am trying to use php to pull the values of the variables out into new variables php can recognize then use the mail() function to send the form.  I already have the following php coding but it doesn't seem to work.  Can anyone help me decode the query string and strip out the values to be sent out with the mail() function???????????


//first we must decode the urlstring

$a = explode('&', $QUERY_STRING);
$i = 0;
while ($i < count($a)) {
    $b = split('=', $a[$i]);
    echo 'Value for parameter ', htmlspecialchars(urldecode($b[0])),
        ' is ', htmlspecialchars(urldecode($b[1])), "<br />\n";

$to = "someone@somewhere.com";

$subject = "flash contact form submission:  ";
$subject .= $thePurpose;

$message = "Name: " . $theName;
$message .= "\nEmail: " . $theEmail;
$message .= "\n\nPurpose: " . $thePurpose;
$message .= "\n\n" . $theMessage;

$headers = "From: " . $theEmail;
$headers .= "\nReply-To: " . $theEmail;

$sentOk = mail($to, $subject, $message, $headers);

echo "sentOk=" . $sentOk;


Thanks in advanced for the help...

#2 jesse8771

  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 30 June 2006 - 07:19 PM

by the way, the output of the query string as it is echoed is as follows:

Value for parameter urlstr is

Hope someone can help...

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users