I am creating a custom captcha where random numbers are generated and you have to add them together etc. As of right now I am echo-ing these random numbers but now I need to pull them into a external file to test the sum against the input text. Can I add these to the POST[] array on form submission?
Share
You have to have some way of keeping track of the numbers and retrieving them back later for verification. You could use session variables- put the numbers in at the time of the page load, and then again when the form is POST’d and check them against each other.
Also, keep in mind anything on the form or that is put in $_POST can be easily viewed by anyone attempting to fool this process. Putting them in session variables makes it much harder for someone to view the contents of what their numbers will be checked against.