Hi. Thanks for the reply. So if I understand correctly.. I call the test_input() function and it checks and fixes input, and return the results. The results are then assigned to the variables $name, $surname, $email, $pwd and then I call ready_to_process() and it does it's job, and set $inputisgood to true. Then I call sql_process() and use the original unchecked, unprocessed (original values that the user input on the form) values $_POST['name'], $_POST['surname'] etc.. to write to the database. In other words, I never updated the actual values in POST array? Thanks a lot.
Hallo everyone. Thanks for a great website. I have been trying for a few days to get a safe, working php form that saves input to mysql. I have looked at several examples from different websites. The problem is that the form values are being stored to the database before the form validation process is complete. I have tried wrapping the process.php code in a function and only calling the function after the validation code is done and implemented some checks in a desperate attempt to resolve the matter using some global variables and a function that checks if the validation