Jump to content

PHP Guestbook CAPTCHA question!! Help!


jjjost

Recommended Posts

Hello,

 

  I am really a newbie with PHP.  I'm really planning on diving into it though.

 

I have a question:

 

  I have a PHP guestbook that is occasional hit with spam comments.  Thus, I am setting up a question that you must answer to post your comments.

 

The input page is: input.htm and the output is: output.php.

Here is the portion of code in the form in input.htm(note the portion in bold):

 

<form name="Entry" method="post" action="output.php">

<h2 align="center"><strong><font face="Georgia, Times New Roman, Times, serif">Hearts At Home Guestbook</font></strong></h2>

<p></p>

<p><strong><font face="Georgia, Times New Roman, Times, serif">Sign Guest Book</font></strong></p>

<h2><textarea name="comment" rows="11" cols="74"></textarea></h2>

<p><strong>Name:</strong></p>

<input type='text' name='name' value=''size='24' border='0'>

<li>Is fire hot or cold?:</li>

<input type='text' name='question' value='' size='24' border='0'>         

      <!--mark_town--><!--mark_mail-->

<p></p>

<input type="submit" name="send" value="Send to Guest Book" border="0">

      <input type="reset" name="reset" value="Reset" border="0">

      <input type="hidden" name="new_entry" value="true">

      <input type="hidden" name="localDate">

</form>

 

And I am not sure how to write out the check in the output.php page. I want it to do something to the effect of:

 

              //CAPTCHA Question

              if ($ ["question"] not equal "hot");

              {

                die ("I'm sorry, you did not answer the fire question correctly. Please try again")

                }

 

Any help would be greatly appreciated.  Please forgive the fragmented code and my total ignorance.  ;D

Link to comment
https://forums.phpfreaks.com/topic/82354-php-guestbook-captcha-question-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.