Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8951837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:45:09+00:00 2026-06-15T13:45:09+00:00

I have a php email script that has worked with a website used it

  • 0

I have a php email script that has worked with a website used it on before, but I’ve moved it over to the re-designed site and when I hit submit the page reloads with this additional text in the url:

?name=Lee+Thomas&email=leethomas%40corwenforestry.co.uk&message=message&Submit=Send

Here’s the form in the contact.html page:

<form name="contact" method="post" action="sendmail.php">
 <table border="0" align="center" cellpadding="0" cellspacing="1">
  <tr>
   <td>
    <input name="name" placeholder="Name" type="text" id="name" size="50">
   </td>
  </tr>
  <tr>
   <td>
    <input name="email" placeholder="Email" type="text" id="email" size="50">
   </td>
  </tr>
  <tr>
   <td>
    <textarea name="message" placeholder="Message" cols="50" rows="4" id="message">
    </textarea>
   </td>
  </tr>
  <tr>
   <td>
     <input type="submit" name="Submit" value="Send"> <input type="reset" name="Reset" value="Reset">
   </td>
  </tr>
 </table>
</form>

And here’s the sendmail.php script:

<?php
if(isset($_POST['email'])) {
    // EDIT THE 2 LINES BELOW AS REQUIRED
    $email_to = "number8pie@gmail.com";
    $email_subject = "CFR F3 Contact Form";


    function died($error) {
        // your error code can go here
        echo "We are very sorry, but there were error(s) found with the form you submitted. ";
        echo "These errors appear below.<br /><br />";
        echo $error."<br /><br />";
        echo "Please go back and fix these errors.<br /><br />";
        die();
    }

    // validation expected data exists
    if(!isset($_POST['name']) ||
        !isset($_POST['email']) ||
        !isset($_POST['message'])) {
        died('We are sorry, but there appears to be a problem with the form you submitted.');       
    }

    $name = $_POST['name']; // required
    $email_from = $_POST['email']; // required
    $message = $_POST['message']; // required

    $error_message = "";
    $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
  if(!preg_match($email_exp,$email_from)) {
    $error_message .= 'The Email Address you entered does not appear to be valid.<br />';
  }
$string_exp = "/^[A-Za-z .'-]+$/";
  if(!preg_match($string_exp,$name)) {
    $error_message .= 'The Name you entered does not appear to be valid.<br />';
  }
  }
  if(strlen($message) < 2) {
    $error_message .= 'The Message you entered do not appear to be valid.<br />';
  }
  if(strlen($error_message) > 0) {
    died($error_message);
  }
    $email_message = "Form details below.\n\n";

    function clean_string($string) {
      $bad = array("content-type","bcc:","to:","cc:","href");
      return str_replace($bad,"",$string);
    }

    $email_message .= "Name: ".clean_string($name)."\n";
    $email_message .= "Email: ".clean_string($email_from)."\n";
    $email_message .= "Message: ".clean_string($message)."\n";


// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);  
?>

Thank you for contacting CF Racing F3, we will be in touch with you very soon.

<?php
?>

Can anyone tell me where I’m going wrong here?

[EDIT] The problem in block quotes below is now solved, the reset button does exactly that.

Another issue I’m having is that the Reset button is acting as another
Submit/Send button, is there a way I can have the Submit/Send button
act as that button?

Thanks in advance for your help.

[EDIT]
Changed the html to remove redundant form tag.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T13:45:09+00:00Added an answer on June 15, 2026 at 1:45 pm

    there is tow <form> tag try after remove one stray <form> tag

    use this

      <form name="contact" method="post" action="sendmail.php">
       <table border="0" align="center" cellpadding="0" cellspacing="1">
    

    instead of

    <form>
     <table border="0" align="center" cellpadding="0" cellspacing="1">
      <form name="contact" method="post" action="sendmail.php">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP email script on my website that potential clients use to
I have a php pipe script that receives an email, takes an attached *.csv
I have a simple php script on my domain that sends me an email:
I have a php script that sends an email. It currently uses the php
I have a one page site that has PHP code in it. Once the
I have a rough php script that sees if a user has filled in
I have a PHP Script that received information from a piped email forwarder. Currently
I have a PHP script which has the source of an email. I aim
I have a PHP script that processes my email subscriptions. It does something like:
I'm clueless when it comes to PHP and have a script that emails the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.