title: php coding error not returning to main page
body: <p>Im new to Php so please be gentle. </p>
  
  <p>I have written a website and i have added a subscribe to newsletter section. The user adds their name and email address before pressing submit. I get the email so the most part is working but the form doesnt return me to the main page of the website. Can anyone point out where i am going wrong please?</p>
  
  <p>Thanks in advance</p>
  
  <p>The code on the website is:</p>
  
  <pre><code>&lt;form name="frmcontact" id="frmcontact" action="php/contact.php" method="post"&gt;
        &lt;input id="name" name="name" type="text" value="Name"
        onblur="this.value=(this.value=='') ? 'Name' : this.value;"              onfocus="this.value=(this.value=='Name') ? '' : this.value;" /&gt;
   &lt;input id="email" name="email" type="text" value="Email" 
   onblur="this.value=(this.value=='') ? 'Email' : this.value;" onfocus="this.value=(this.value=='Email') ? '' : this.value;" /&gt;
  &lt;input name="submit" id="send" type="submit" value="Message" /&gt;
  &lt;/form&gt;
  
  
  The code in contact.php is:
  
  &lt;?php session_start();
  
  if(!$_POST) exit;
  
      $address = 'email@emailaddress.com';
      $email_subject ="Add me to the mailing list";
      $email    = $_REQUEST['email'];
      $name     = $_REQUEST['name'];
      $subject  = "Please add me to the mailing list ";
  
          if(get_magic_quotes_gpc()) { $comment = stripslashes($comment); }
  
  
           $e_subject = 'You\'ve been contacted by ' . $name . '.';
  
           $msg  = "You have been contacted by $name with regards to $subject.\r\n\n";
           $msg .= "$message\r\n\n";
           $msg .= "You can contact $name via email, $email.\r\n\n";
           $msg .= "-------------------------------------------------------------------------------------------\r\n";
  
          if(@mail($address, $subject, $msg, "From: $email\r\nReturn-Path: $email\r\n"))
          {echo "&lt;p class='ajax_success'&gt;Thanks for Contact Us.&lt;/p&gt;"; }
           else
           {echo "&lt;p class='ajax_failure'&gt;Sorry, Try again Later.&lt;/p&gt;"; }
      header('Location:http://www.websiteaddress/homepage.html');
  ?&gt;
  </code></pre>