Emails from myself!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Andy128
    Major General

    • Dec 2005
    • 2317

    #16
    Re: Emails from myself!!

    It would appear that some one has bookmarked your action.php page and upon bringing it up in their browser- it sends a blank email.

    For this I believe we should test to see weather the "Submit" button was pressed. If it hasn't, then the page will simply re-direct back to the form.

    I am not where I can look up and write that bit of code. Give me an hour and I will have something for you.

    In the mean time, try it your self by going directly to the action.php page with out going through the form. Do it a few times and then check your e-mail.

    Andy
    PHP- is a blast!

    Comment

    • Andy128
      Major General

      • Dec 2005
      • 2317

      #17
      Re: Emails from myself!!

      Jonathan-
      Replace your php script with this one:

      <?PHP
      if(!isset($_POST['submit']))
      {
      echo"<br /><br /><center>You must us the submit button in order for the data to be sent. Please use the<br /> back button and then hit submit.</center>";
      exit;
      }
      else
      {
      $mailto = "info@susancoates.co.uk";
      $email = $HTTP_POST_VARS['email'];
      if ($email == "")
      {
      $email = $mailto;
      }
      $mailsubj = "Contact Form Submission";
      $mailhead = "From: $email\n";
      reset ($HTTP_POST_VARS);
      $mailbody = "Submitted from Contact Submission Form :\n";
      while (list ($key, $val) = each ($HTTP_POST_VARS))
      {
      if ($key!="submit")
      {
      $mailbody .= "$key : $val\n";
      }
      }
      }
      mail($mailto, $mailsubj, $mailbody, $mailhead);
      ?>

      That should stop it. Make sure to test it throughly.

      Andy
      PHP- is a blast!

      Comment

      Working...
      X