Jump to content

PHP form data return


POMO-man

Recommended Posts

Hi, all. I'm trying to set up PHP to have the contents of a form sent to my email box.It's partly working, because I do actually GET an email when I test this form, but the data in the fields won't come through with the email. I'm basically just getting a blank email. Here's the PHP:

<?  $email = $_REQUEST['email'] ;  $message = $_REQUEST['message'] ;  $name = $_REQUEST['name'] ;  $phone = $_REQUEST['phone'] ;  $phoneAreaCode = $_REQUEST['phoneAreaCode'] ;  $phonePrefix = $_REQUEST['phonePrefix'] ;  $phoneSuffix = $_REQUEST['phoneSuffix'] ;  $phoneExtension = $_REQUEST['phoneExtension'] ;  $fax = $_REQUEST['fax'] ;  $faxAreaCode = $_REQUEST['faxAreaCode'] ;  $faxPrefix = $_REQUEST['faxPrefix'] ;  $faxSuffix = $_REQUEST['faxSuffix'] ;  $topic = $_REQUEST['topic'] ;    $finalMessage = $email + $message + $name + $phone + $phoneAreaCode + $phoneSuffix + $phonePrefix + $phoneExtension + $faxAreaCode + $faxSuffix + $faxPrefix + $topic ;  mail( "chad@pservices.net", "Contact Form Results",    $finalMessage, "From: $email" );  header( "Location: [url="http://www.printingservices.net/contact.html""]http://www.printingservices.net/contact.html"[/url] );?>

Here's the link where the form can be found:www.printingservices.net/contact.htmlIf you guys could help, that would be GREAT.

Link to comment
Share on other sites

Hi, all. I'm trying to set up PHP to have the contents of a form sent to my email box.It's partly working, because I do actually GET an email when I test this form, but the data in the fields won't come through with the email. I'm basically just getting a blank email. Here's the PHP:
<?  $email = $_REQUEST['email'] ;  $message = $_REQUEST['message'] ;  $name = $_REQUEST['name'] ;  $phone = $_REQUEST['phone'] ;  $phoneAreaCode = $_REQUEST['phoneAreaCode'] ;  $phonePrefix = $_REQUEST['phonePrefix'] ;  $phoneSuffix = $_REQUEST['phoneSuffix'] ;  $phoneExtension = $_REQUEST['phoneExtension'] ;  $fax = $_REQUEST['fax'] ;  $faxAreaCode = $_REQUEST['faxAreaCode'] ;  $faxPrefix = $_REQUEST['faxPrefix'] ;  $faxSuffix = $_REQUEST['faxSuffix'] ;  $topic = $_REQUEST['topic'] ;    $finalMessage = $email + $message + $name + $phone + $phoneAreaCode + $phoneSuffix + $phonePrefix + $phoneExtension + $faxAreaCode + $faxSuffix + $faxPrefix + $topic ;  mail( "chad@pservices.net", "Contact Form Results",    $finalMessage, "From: $email" );  header( "Location: [url="http://www.printingservices.net/contact.html""]http://www.printingservices.net/contact.html"[/url] );?>

Here's the link where the form can be found:www.printingservices.net/contact.htmlIf you guys could help, that would be GREAT.

i think it should go like this:
$finalMessage = $email . $message . $name . $phone ...

instead of using the plus (+) sign..

Link to comment
Share on other sites

Coolness. Well, that worked. the data came through with the email.However, it is all in one long string, without any indication of which field it is from. Now, of course i can sort it out, but it's sorta confusing.Is there a way to get each field of info labeled somehow within the email PHP sends? Or at least get each one on its own separate line? How are others solving this issue?THANKS AGAIN!

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...