new... need some help, please!

I’m completely new to PHP and can’t understand why it’s redirecting me but I’m not receiving the emails. (I have double checked the spelling of my email address.) Am I missing something? Help?


<?php if(!isset($_POST['submit'])) { //This page should not be accessed directly. Need to submit the form. echo "error; you need to submit the form!"; } $name2 = $_POST['name2']; $name3 = $_POST['name3']; $email = $_POST['email']; $how = $_POST['how']; $subject = $_POST['subject']; $message = $_POST['message']; $email_from = '[email protected]'; $email_subject = "New Form Submission"; $email_body = "You have received a new message from the user $name.\n". "Here is the message:\n $message". $to = "[email protected]"; $headers = "From: $email_from \r\n"; $headers .= "Reply-To: $visitor_email \r\n"; mail($to,$email_subject,$email_body,$headers); header('Location: index.html'); // Function to validate against any email injection attempts function IsInjected($str) { $injections = array('(\n+)', '(\r+)', '(\t+)', '(%0A+)', '(%0D+)', '(%08+)', '(%09+)' ); $inject = join('|', $injections); $inject = "/$inject/i"; if(preg_match($inject,$str)) { return true; } else { return false; } } ?>


Email Form

Once you submit, you will be redirected to the home page.

                              <li id="li_1" >
                  <label class="description" for="name1">Name </label>
                      <input name= "name2" class="element text" maxlength="255" size="8" value=""/>
                      <input name= "name3" class="element text" maxlength="255" size="14" value=""/>
                  </li>		<li id="li_2" >
                  <label class="description" for="email">Email </label>
                      <input name="email" class="element text medium" type="text" maxlength="255" value=""/> 
                  </li>		<li id="li_3" >
                  <label class="description" for="how">How did you find Equate Designs? </label>
                      <input name="how" class="element text medium" type="text" maxlength="255" value=""/> 
                  </li>		<li id="li_5" >
                  <label class="description" for="subject">Subject </label>
                      <input name="subject" class="element text medium" type="text" maxlength="255" value=""/> 
                  </li>		<li id="li_4" >
                  <label class="description" for="message">Message </label>
                      <textarea name="message" class="element textarea medium"></textarea> 
                              <li class="buttons">
                          <input name="submit" input type="submit" value="Submit" />
                  </form>	<script language="JavaScript">

// Code for validating the form
// Visit
// for details
var frmvalidator = new Validator(“myemailform”);
frmvalidator.addValidation(“name”,“req”,“Please provide your name”);
frmvalidator.addValidation(“email”,“req”,“Please provide your email”);
frmvalidator.addValidation(“email”,“email”,“Please enter a valid email address”);

Did you check the SPAM folder on your Gmail? Also you can try to remove \r from the email headers.

Sponsor our Newsletter | Privacy Policy | Terms of Service