title: Captcha with Form trouble
body: <p>I keep seeing if statements showing as text on the domain <a href="http://bambooflooringcapetown.net/recap.php" rel="nofollow">http://bambooflooringcapetown.net/recap.php</a></p>
  
  <p>you can see for yourself.</p>
  
  <p>I am trying to implement Securimage into my form but having troubles.</p>
  
  <p>Captcha i am using:
  <a href="http://www.phpcaptcha.org/documentation/quickstart-guide/" rel="nofollow">http://www.phpcaptcha.org/documentation/quickstart-guide/</a></p>
  
  <p>Current Code:</p>
  
  <pre><code>     &lt;?php
  error_reporting(E_ALL);
  ini_set('display_errors', 1);
  session_start();
  
  ?&gt;
  &lt;div&gt;
      &lt;?php
  require_once 'securimage/securimage.php';
  // Code Validation
  
  $image = new Securimage();
  if ($image-&gt;check($_POST['captcha_code']) == true) {
    echo "Correct!";
  } else {
    echo "Sorry, wrong code.";
  }
          require_once 'securimage/securimage.php';
          echo Securimage::getCaptchaHtml();
      ?&gt;
  &lt;/div&gt;
  &lt;style&gt;
  #newheadform
  {
      position: relative;
      top: -15px;
      left: 700px;
      width: 280px;
      height: 361px;
      border: 1px solid #&lt;?php echo $Config['bodyFontColour']; ?&gt;;
      background-color: #&lt;?php echo $Config['bodyColour']; ?&gt;;
      color: #&lt;?php echo $Config['bodyFontColour']; ?&gt;;
      opacity: 0.85;
      padding: 10px;
      z-index: 100;
      font-family: sans-serif;
  }
  #newheadform input[type=text], #newheadform textarea
  {
      border: 1px solid #000;
      width: 96%;
  }
  &lt;/style&gt;
  &lt;!-- NEW ENQUIRY FORM START --&gt;
  
  &lt;form method="post" action=""&gt;
  &lt;table id="newheadform" cellpadding="5" cellspacing="0"&gt;
          &lt;tr&gt;&lt;th colspan="2" align="center"&gt;&lt;font size="5"&gt;Email us now&lt;/font&gt;&lt;/th&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Name*:&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="name"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Phone*:&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="number"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Email*:&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="email"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td colspan="2"&gt;Message:&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td colspan="2"&gt;&lt;textarea name="message" style="height: 50px;"&gt;&lt;/textarea&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td colspan="2" align="center"&gt;
  &lt;input type="text" name="captcha_code" size="10" maxlength="6" /&gt;
  &lt;a href="#" onclick="document.getElementById('captcha').src = '/securimage/securimage_show.php?' + Math.random(); return false"&gt;Different Image&lt;/a&gt;
          &lt;?php if(isset($_POST['number']))
          {
              if(empty($_POST['name']) || empty($_POST['number']) || empty($_POST['email']))
                  echo '&lt;font color="red" size="1"&gt;&lt;b&gt;* These fields are compulsory&lt;/b&gt;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;';
              else
              {
                  $headers='From: '.$_POST['email']."rn";
                  $headers.='Reply-To: '.$_POST['email']."rn";
                  $headers.='X-Mailer: PHP/'.phpversion();
                  $body='You received a contact request from '.$_POST['name'].' ('.$_POST['email'].') on your site '.$domainname."rn";
                  $body.='Contact number: '.$_POST['number']."rnrn";
                  if(!empty($_POST['message'])) $body.=$_POST['message'];
                  if(mail($_SESSION['contact3'],'New Enquiry from '.$domainname,$body,$headers))
                      echo '&lt;font color="green"&gt;&lt;b&gt;Your email has been sent&lt;/b&gt;&lt;/font&gt;&lt;br/&gt;';
              }
          }
  ?&gt;
                  &lt;img id="captcha" src="securimage/securimage_show.php" alt="CAPTCHA Image" /&gt;
          &lt;input type="button" name="send" value="Send"/&gt;&lt;/td&gt;&lt;/tr&gt;
  
  &lt;/table&gt;
  &lt;/form&gt;
  
  
  &lt;!-- NEW ENQUIRY FORM END --&gt;
  </code></pre>
  
  <p>ORIGINAL CODE WITH NO CAPTCHA</p>
  
  <pre><code>    &lt;!-- NEW ENQUIRY FORM START --&gt;
  &lt;style&gt;
  #newheadform
  {
      position: relative;
      top: -15px;
      left: 700px;
      width: 280px;
      height: 361px;
      border: 1px solid #&lt;?php echo $Config['bodyFontColour']; ?&gt;;
      background-color: #&lt;?php echo $Config['bodyColour']; ?&gt;;
      color: #&lt;?php echo $Config['bodyFontColour']; ?&gt;;
      opacity: 0.85;
      padding: 10px;
      z-index: 100;
      font-family: sans-serif;
  }
  #newheadform input[type=text], #newheadform textarea
  {
      border: 1px solid #000;
      width: 96%;
  }
  &lt;/style&gt;
  &lt;form method="post" name="newheadformform"&gt;
      &lt;table id="newheadform" cellpadding="5" cellspacing="0"&gt;
          &lt;tr&gt;&lt;th colspan="2" align="center"&gt;&lt;font size="5"&gt;Email us now&lt;/font&gt;&lt;/th&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Name*:&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="name"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Phone*:&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="number"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Email*:&lt;/td&gt;&lt;td&gt;&lt;input type="text" name="email"/&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td colspan="2"&gt;Message:&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td colspan="2"&gt;&lt;textarea name="message" style="height: 50px;"&gt;&lt;/textarea&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td colspan="2" align="center"&gt;
          &lt;?php if(isset($_POST['number']))
          {
              if(empty($_POST['name']) || empty($_POST['number']) || empty($_POST['email']))
                  echo '&lt;font color="red" size="1"&gt;&lt;b&gt;* These fields are compulsory&lt;/b&gt;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;';
              else
              {
                  $headers='From: '.$_POST['email']."rn";
                  $headers.='Reply-To: '.$_POST['email']."rn";
                  $headers.='X-Mailer: PHP/'.phpversion();
                  $body='You received a contact request from '.$_POST['name'].' ('.$_POST['email'].') on your site '.$domainname."rn";
                  $body.='Contact number: '.$_POST['number']."rnrn";
                  if(!empty($_POST['message'])) $body.=$_POST['message'];
                  if(mail($_SESSION['contact3'],'New Enquiry from '.$domainname,$body,$headers))
                      echo '&lt;font color="green"&gt;&lt;b&gt;Your email has been sent&lt;/b&gt;&lt;/font&gt;&lt;br/&gt;';
              }
          }
          else echo '&lt;font size="1"&gt;* Compulsory&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;'; ?&gt;
      Calculate*: &lt;span id="num1"&gt;&lt;/span&gt; + &lt;span id="num2"&gt;&lt;/span&gt;&amp;nbsp;&lt;input type="number" name="calculate" placeholder="" /&gt;&lt;br&gt;&lt;br&gt;
          &lt;input type="button" name="send" value="Send"/&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;/table&gt;
  &lt;/form&gt;
  &lt;script type="text/javascript"&gt;
  $(document).ready(function(e) {
  
      var number1 = Math.floor(Math.random()*12)+1;
      var number2 = Math.floor(Math.random()*12)+1;
  
      $('#num1').append(number1);
      $('#num2').append(number2);
  
    $('input[name=send]').click(function(){
  
          var total = number1 + number2;
          var answer = $('input[name=calculate]').val();
  
          if(total !== parseInt(answer)){
  
              alert("Please enter the correct calculation to send your enquiry.");
  
          } else {
  
              document.newheadformform.submit(); 
              return false;
  
          }
      });
  });
  &lt;/script&gt;
  &lt;!-- NEW ENQUIRY FORM END --&gt;
  </code></pre>