Hello all,
I am new to PHP coding. I am trying to create PHP scripting that makes my contact form functional. I would like the information from the contact for to be sent to my email address. I have watched a few tutorials and attempted to test the functionality using XAMPP.
Let me know if you see any errors you can help me out with. I receive error notices stating that some of the variables are not defined.
[HTML code]
Email Address: A value is required.Invalid format. |
---|
Name: A value is required. |
Comment: A value is required. |
[php]
<?php /*Subject and email variables*/ $emailSubject = 'Comment from Measuring Sustainability Website'; $webMaster = '[email protected]'; /*Gathering Data Variables*/ $emailField = $_POST['email']; $nameField = $_POST['name']; $messageField = $_POST['message']; $body = <<<EODEmail: $email
Name: $name
Message: $message
EOD; $headers = "From: $email\r\n"; $headers .= "Content-type: text/html\r\n"; $success = mail($webmaster, $emailSubject, $body, $headers); /*Results rendered in HTML*/ $theResults = <<<EOD Measuring Sustainability | US EPA
Jump to main content or area navigation.
- A-Z Index
- Advanced Search
- What are you looking for?
SHCRP: Indices and Indicators Project
- You are here: EPA Home
- Sustainable and Healthy Communities
- Measuring Sustainability
Area Navigation
The Seal of the United States Environmental Protection Agency
[/php]