Jump to content

jPaulB

Members
  • Posts

    5
  • Joined

  • Last visited

jPaulB's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the reply, requinix. I appreciate the time you've given to my issue. It seems that using simple math to block anything but a human visitor is not a good idea, so I will need to do some research to find a method that I can understand and use. With that in mind, could you suggest a "topic" that I can google to research intelligently? Many Thanks, if you can respond Paul
  2. Hi Everybody, I have a simple form that mixes HTML and PHP. I thought I could get fancy and add a simple security level before the form action. I have a snippet that prepares for a random number between 1 and 99, and call that random number $entry <?php $firstnumb = rand(1,9); $secondnumb = rand(1,99); $entry = $firstnumb + $secondnumb; ?> A visitor will see a display box that asks them to add the two numbers ... <?php print "<SPAN style='color: #0000FF'><B>$firstnumb + $secondnumb</B></SPAN>"; ?> and enter the answer in a text box <input type="text" class="form-control" placeholder="Enter the answere here" id="entry1" name="entry1" required > So now I just have to compare the value of $entry to the value of entry1, and do one of two things. That's where I crash and burn. If the values compare, I just need to break and move on If the values do not compare, then I want to: Replace the value of entry1 to "0" Alert the visitor that he needs to correct their answer. Return focus to the input box and do it again. Perhaps allow a limit of 3 attempts. I don't know how to do any of this and hope someone will help me. Many Thanks, Paul
×
×
  • 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.