Create User Signup Form - Web Development with PHP & MySQL
HTML-код
- Опубликовано: 28 июн 2024
- View On Website:
scottsweb.dev/create-signup-f...
#webdevelopment #learning #programming #programminglanguage #php #mysql #signup #scratch #fromscratch #learnwebdevelopment #website #websites
In this tutorial, I'll be showing you how to create a registration form from scratch using PHP & MySQL.
We will set up a simple header, content, footer system for a signup.php page. We'll make the forms using HTML. Then we'll validate the data with PHP, checking string length, email validation, password requirement validation, and that passwords match.
If there are any errors, the user is shown the errors and the form pre-populates with the user entered data.
After successful submission, the data is inserted as a new row into the users table.
We then do some basic validation with javascript. The javascript is more user friendly but cannot be relied upon for sole validation. You have to do the PHP validation first.
2:11 : Create a users database table
4:21 : Building the form
10:00 : Processing posted form data
11:40 : Error handling container
12:00 : Check required fields
13:48 : Show error messages
15:30 : Assign post data to variables
16:36 : Data validation - max length
18:01 : Query to see if signup email already exists
20:24 : Validate posted email
21:33 : Validate password requirements
26:30 : Hash the posted password
28:17 : Using prepared statement to insert data into users table
30:46 : Display success message
33:14 : Re-populate form data
38:15 : Viewing inserted data in PHPMyAdmin
39:45 : Creating javascript file
42:08 : Validating required fields in javascript, adding error class for invalid input
47:55 : Submitting the form passing javascript validations, as well
If this video was helpful, please subscribe to my channel! Coming up we will have tutorials on sending emails with verification links, logging in and out, lost password, auto-login cookies, and more.
Thanks for watching! Наука