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 8025125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:03:58+00:00 2026-06-04T23:03:58+00:00

Well I’m working on my first PHP code, in the way of a simple

  • 0

Well I’m working on my first PHP code, in the way of a simple form mailer. I can’t seem to see why its generating the error

We are very sorry, but there were error(s) found with the form you
submitted. These errors appear below.

We are sorry, but there appears to be a problem with the form you
submitted.

Please go back and fix these errors.

If anyone well versed in PHP sees the issue, I’d appreciate any guidance you can give.

The HTML

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>untitled</title>
</head>

<body>
<form action="send_form_email.php" method="post">
<fieldset>
<legend> Error Report:</legend>
<p><input name="name" type="text" placeholder="Your Name" autofocus></p>
<p><input name="email" type="text" placeholder="email@domain.com"></p>
<p><textarea name="descpirtion" placeholder="Give a description of the error."></textarea></p>
<p><label>What internet browser were you using when the error occured?</label></p>
<p><select name="browser"><option>Internet Explorer</option><option>Chrome</option><option>Safari</option><option>Firefox</option></select></p>
<p><input type="submit" value="Submit"> <input type="reset" value="Cancel"></p>
</fieldset>
</form>

</body>
</html>

the CSS

body {background: #222; padding: 1em; margin: 0; font-size: 16px; color: #777;}
     body * {margin: 0; padding: 0; font-family: helvetica, sans-serif;}
     p {margin: 0 0 1em; font-size: 14px;}

    input, textarea, select {
     border: 1px solid #111;
     border-radius: 5px;
     padding: 0.5em;
     font-size: 15px;
     line-height: 1.2em;
     width: 80%;
     background: #444;
     color: #999;
     font-family: helvetica, sans-serif;
     background: -webkit-gradient(linear, left top, left bottom, from(#222), to(#444));
     -webkit-appearance: none;
       -webkit-box-shadow: 1px 1px 1px #333;
     }

     input:focus, textarea:focus, select:focus {outline-color: #FC0;}

   textarea {
       color: #999;
       border-radius: 5px;
       height: 55px;
       background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #222), color-stop(0.05, #333));
   }

   select {
       color: #999;
       border-radius: 5px;
       padding: 0.5em 1em 0.5em 0.75em;
       background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #222), color-stop(0.05, #333));
}


     input[type=text] {
     color: #999;
     border-radius: 5px;
     background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #222), color-stop(0.12, #333));
   }

   input[type=submit] {
     color:#FFF;
     border-radius: 5px;
     width: auto;
     padding: 0.25em 1em;
     line-height: 1.5em;
     background: -webkit-gradient(linear, left top, left bottom, from(#FC0), to(#FF0));
     border: 2px solid #FC0;
     text-shadow: 0 0 2px #300;
     font-weight: bold;
     -webkit-box-shadow: 1px 1px 3px #000;
     margin-right: 0.5em;
   }

   input[type=reset] {
      border-radius: 5px;
      width: auto;
      padding: 0.25em 1em;
      line-height: 1.5em;
      background: -webkit-gradient(linear, left top, left bottom, from(#333), to(#222));
      border: 2px solid #444;
      text-shadow: 0 0 2px #300;
      font-weight: bold;
      color: #999;
      -webkit-box-shadow: 1px 1px 3px #000;
    }
label{
    color: #999;
}

leged{
    padding: 5px;
    margin: 5px;
}

the PHP

<?php
if(isset($_POST['email'])) {

    // EDIT THE 2 LINES BELOW AS REQUIRED
    $email_to = "webmaster@canyonlakemma.com";
    $email_subject = "Website Error Report";


    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['first_name']) ||
        !isset($_POST['email']) ||
        !isset($_POST['description']) ||
        !isset($_POST['browser'])) {
        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
    $description = $_POST['description']; // required
    $browser = $_POST['browser']; // 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 .= 'Be sure to include your name.<br />';
  }
  if(strlen($description) < 2) {
    $error_message .= 'Please include a description of the error.<br />';
  }
  if(strlen($browser) < 2) {
    $error_message .= 'Please select your browser.<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($first_name)."\n";
    $email_message .= "Email: ".clean_string($email_from)."\n";
    $email_message .= "Description: ".clean_string($description)."\n";
    $email_message .= "Browser: ".clean_string($broswer)."\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);  
?>

<!-- include your own success html here -->

Thank you for contacting us. We will be in touch with you very soon.

<?php
}
?>
  • 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-04T23:04:00+00:00Added an answer on June 4, 2026 at 11:04 pm

    !isset($_POST['description']) doesn’t use the same id as <textarea name="descpirtion"

    desc-p-i-r-tion 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Well, it seems simple enough, but I can't find a way to add a
Well, this must be a silly one. Here below is a can-not-be-simpler code in
Well let me explain the code first: First the user enters the id, the
Well I am using the following code to take any old image into a
Well, not random, because its the same every time, but #include<iostream> using namespace std;
Well im here because i have a problem. i have code that was created
Well I created a jquery mobile form but the every element is in a
well. i was use Reactive Extensions (Rx) package async Request,Before you can start writing
Well, I just started to work on server side scripting , I chose PHP,
Well i currently want to do a search engine with SQL and PHP. I

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.