jjjost Posted December 19, 2007 Share Posted December 19, 2007 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. Quote Link to comment Share on other sites More sharing options...
xiao Posted December 19, 2007 Share Posted December 19, 2007 You mean if($_POST['question'] != "hot"){ die ("I'm sorry, you did not answer the fire question correctly. Please try again"); } ? Quote Link to comment Share on other sites More sharing options...
jjjost Posted December 19, 2007 Author Share Posted December 19, 2007 Ahhh!! EXACTLY what I was looking for. THANK YOU! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.