Jump to content

[SOLVED] not receiving all text inputed through my email


cluce

Recommended Posts

I am baffled. Can someone tell me why the only output I receive in my email is the message: what ever submitted showed up. My name and email doesn't work???

 

here is my code........

<?php
echo "<p>Thank you, <b>".$_POST["name"]."</b>, for your message!</p>";
echo "<p>Your email address is: <b>".$_POST["email"]."</b>.</p>";

//set up the mail
$recipient = "[email protected]";
$subject = "Form Submission Results"; 

//start building the mail string 
$msg = "name: ".$_POST["name"]."\n";
$msg = "email: ".$_POST["email"]."\n";
$msg = "message: ".$_POST["message"]."\n";

//send mail
mail ($recipient, $subject, $msg);
?>

 

whenever you are setting your variable $msg you need to concate it with ( .= )

 

what you have now is setting $msg to name, then over writing that with email, and finally setting $msg to the message

 

$msg = "name: ".$_POST["name"]."\n";
$msg .= "email: ".$_POST["email"]."\n";//dont forget the period before the equal sign
$msg .= "message: ".$_POST["message"]."\n";//dont forget the period before the equal sign

 

EDIT:

THIS SHOULD BE POSTED IN THE PHP FORUM, NOT THE MYSQL FORUM

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.