SuperPaperSam Posted August 25, 2009 Share Posted August 25, 2009 I have a PHP form and it works fine but it says that it's from 'nobody' How can I fix this??? I want it to say it was sent from $emailFieldPHP Code <?php $emailsubject = 'Contact'; $webMaster = 'sorry w3schools i dont want everyone knowing my email'; $nameField = $_POST ['name']; $emailField = $_POST ['email']; $messageField = $_POST ['message']; $body = <<<EOD<br><hr><br>Name: $nameField <br>Email: $emailField <br><hr><br>Message: $messageField <br><br><hr><br>EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailsubject, $body, $headers); $theResults = <<<EOD<html><head><title>Email has been success fully sent!</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css"><!--body { background-color: #f1f1f1; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; line-height: normal; font-weight: normal; color: #666666; text-decoration: none;}--></style></head><div> <div align="left">Thank you for contacting me I will get back to you soon!</div></div></body></html>EOD;echo "$theResults"?> Any help would be appreciatedThanks! Link to comment Share on other sites More sharing options...
justsomeguy Posted August 25, 2009 Share Posted August 25, 2009 You're trying to set the from address to the $email variable, that doesn't exist. Link to comment Share on other sites More sharing options...
SuperPaperSam Posted August 25, 2009 Author Share Posted August 25, 2009 WOW. I just noticed that I should of put Field after it.... wow... im dumb...But thanks for the help Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.