Hello,
Quick question...
Currently I have a registration page that submits all the user data to Join.php.
Join.php imports file 'func.php' - a linear file with functions that returns pointed to Db, make queries and return results.
Join.php validates the user data and if errors are found, it redirects the user to the registration page and outputs all the errors found (I made an array of all encounted errors and placed the array in a session variable).
I am thinking of changin this way to something like this:
Registration pages sends data to class ProcessRegistration.php
ProcessRegistration.php then will take all the data posted ($_POST), and send it to a class User. Class user will import the 'func.php' file and and check if the user exists in the DB or not. Class user will validate the data and then if there are errors, the object user will be placed inside the session variable and then the error will be displayed.
Also, all the input fields will be repopulated with data from the object User. The input fields will be repopulated through get methods.
My primary reason to do this is because i didnt' want to place all the input fields into the session object and then repopulate them.. I think its easier on the eyes to do it with a whole object....
So what do you pros recommends?