title: PHP echo in a HTML Page
body: <p>I have a contact.<strong>html</strong> page I have a form on.  The form action goes to .php page to handle the email, nothing special. On that page I have:</p>
  
  <pre><code>&lt;?php
  function check_input($data)
  {
  $data = trim($data);
  $data = stripslashes($data);
  $data = htmlspecialchars($data);
  return $data;
  }
  
  $FirstName = check_input($_REQUEST['FirstName']);
  $LastName = check_input($_REQUEST['LastName']);
  $email = check_input($_REQUEST['email']);
  $phone = check_input($_REQUEST['phone']);
  $message = check_input($_REQUEST['message']);
  $human = check_input($_REQUEST['human']);
  $webpackage = check_input($_REQUEST['webpackage']);
  $webdesign = check_input($_REQUEST['webdesign']);
  $customdesign = check_input($_REQUEST['customdesign']);
  
  if ($human == 5) {
  
  $to = "****.com";
  $subject = "From ****";
  
  $body = " From: $FirstName  $LastName\n\n E-Mail: $email\n\n Phone:     $phone\n\n Message:\n\n $message\n\n Web Package:$webpackage\n\n Web     Design:$webdesign\n\n Custom Design:$customdesign";
  
  
  mail ($to, $subject, $body);
  header('location: index.html');
  }
  else {
  $result="&lt;div class=\"alert alert-danger\"&gt;Sorry there was an error sending     your message. Please go back and check your anti-spam answer&lt;/div&gt;";
  }
  
  ?&gt;
  </code></pre>
  
  <p>I have a simple box that equals 5 that I am checking value for.  This works and email sent with all info.  <strong>BUT</strong> if not equal to 5 is where the problem starts. The page goes to my <code>action.php</code> page and is blank.</p>
  
  <p>My html on the <code>contact.html</code> page is:</p>
  
  <pre><code>    &lt;div class="form-group"&gt;
                  &lt;div class="col-sm-10 col-sm-offset-2"&gt;
                      &lt;?php echo($result); ?&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>Using this to get to my <code>action.php</code> page through form. Everything else is .html:</p>
  
  <pre><code> &lt;form class="form-horizontal" id="contact-form" method="post" action="/action.php"&gt;
  </code></pre>
  
  <p>Is there a way to do this? I have a work around where I just <code>echo</code> the error from the <code>.php</code> page. This works if <code>!=5</code> but not exactly what I want to do.  As you may tell, I am not PHP literate.</p>