I am trying to customize my signup page by adding another field which is the "Image text" for extra security purposes. User is asked to input the image text being displayed. If he/she fails to provide correct text, an error is displayed. The problem is that although I got it working all the way to the agreement page, I got stuck after that. After user hits the agree button, he gets back to the signup page and gets the "Wrong text" error. Needless to say that the image changes on each reloading of the page. So, I am trying to figure out how to do the check only once, and then skip the procedure. Here is the code snippet: PHP: $img = new securimage(); $valid = $img->check($_POST['imagetext']); if(!$valid) { $error[] = "The text you entered is not correct!"; }
do something like this: PHP: $img = new securimage();if (!$_SESSION['img_check_ok']){ $valid = $img->check($_POST['imagetext']); if(!$valid) { $error[] = "The text you entered is not correct!"; } else { // if valid $_SESSION['img_check_ok'] = true; }}