catz_art Posted June 23, 2011 Share Posted June 23, 2011 Hello, My 1st inquiry. I have a simple contact form. My hosting account is through GoDaddy, a deluxe hosting account, the email is through gmail (wyan.org). The form comes through to my email account, but the variables do not post The subject does get sent through, but the email field is supposed to insert the email from the person who filled out the form, & it is defaulting to the Hosting account's primary user name. Please help me get my form working! <?php /* Subject & email variables */ $emailSubject = 'Request from website'; $webMaster = '[email protected]'; /* Gathering Data Variables */ $strSubjectField = $_POST['strSubject']; $NameField = $_POST['Name']; $EmailField = $_POST['Email']; $PhoneField = $_POST['Phone']; $CommentsField = $_POST['Comments']; $body = <<<EOD <br><hr><br> Subject: $strSubject<br> Name: $Name <br> Email: $Email <br> Phone Number: $Phone <br> Comments: $Comments <br> EOD; $headers = "From: $Email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webMaster, $emailSubject, $body, $headers); /* Results redered as HTML */ $theResults = <<<EOD <html> <head> <title>Thank You! Pallottine Fathers</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body { background-color: #033; font-family: Arial, Verdana, Univers; font-size: 14px; font-style: normal; line-height: normal; font-weight: normal; color: #FFF; text-decoration: none; } --> </style> </head> <div> <div align="left">Thank you for your interest! Your email will be answered very soon!</div> </div> </body> </html> EOD; echo "$theResults"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/240236-contact-form/ Share on other sites More sharing options...
Pikachu2000 Posted June 23, 2011 Share Posted June 23, 2011 Rather than attaching the file with the php code in it, post it within the forum's . . . BBCode tags. Most people will not download an attached file. Quote Link to comment https://forums.phpfreaks.com/topic/240236-contact-form/#findComment-1234012 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.