Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # In create_user.php
- * Create two methods, one to validate the input and one to actually persist into the DB
- * Write both methods so that they accept a parameter instead of pulling from $_POST
- * Have the validate method return an associative array of field => error. So like:
- function validate($params){
- // stuff here
- return ["password" => "too short", "username" => "in use"];
- }
- # In index.php
- * Call validate, and if there are errors stick them above the field with some Bootstrap errors ;)
- * Put the original values of the form in if there's an error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement