-
Notifications
You must be signed in to change notification settings - Fork 0
PHP Registration Form
This simple code link is meant to get you started in basics of php/html/css/javascript/mysql.
This link instructs you in Python by slowly building and establishing skills through techniques like practice and memorization, then applying them to increasingly difficult problems. By the end of the book you will have the tools needed to begin learning more complex programming topics. I like to tell people that my link gives you your "programming black belt." What this means is that you know the basics well enough to now start learning programming.
If you work hard, take your time, and build these skills, you will learn to code.
The page has detailed documentation for every line of code. This is basically a simple registration form in php.
The link consists of various files. the question
One can even have a look at the other features included like floating menu, keyboard shortcuts,css,jquery,javascript,html.
An index.php file, having a Welcome message, “Welcome to File processing” and two links, “Register” & “Login” taking to register.php and login.php details about which are given below.
Write register.php that takes Name, User Name, Password, Mobile number and E-mail id as input. Use HTML 5 validation to ensure all fields are mandatory.
Upon submitting the form, these details should be written to a file users.txt in a newline as colon separated values and message “Dear User, Thank you for enrolling.” message should appear for users returning back to index.php.
If the file exist append, else create and keep adding.
The User name is unique. Ensure the file doesn't have a line containing same user name as the one being added. If user name already exist, Error message “Same User name exist, Try again with a different one.” must come & other than user name and password all other values must be retained back in the form.
Write login.php that takes User name and Password as inputs (they are mandatory fields) & when submitted it accesses the file to check is user name exist in lines and if exist the password is right.
Hint: Loop through lines, Use explode() to store user name and pass word as an associative array first, Use array_key_exist() to check if user name exist, then compare password
If credentials are right then take to a user.php else return to same page displaying error message “Bad Credentials”.
The user.php displays a welcome message “Welcome User. Thank you for visiting back.” has a link to profile.php as Profile and password_change.php as Change Password
Upon clicking Profile returns fields Name, Mobile number and E-mail ID with their values for the User logged in, read from the file. An update button that will update the corresponding line in the file & return to user.php with success message “Profile successfully updated”.
Upon clicking Change Password, will return a form asking for current password & new password and searches the file, verifies that the current password matches and if so updates the line with the new password and returns back to user.php with success message, “Password successfully updated” else returns to password_change.php saying “Current password is wrong”.
Hint: Use a hidden field to store User ID after logging in, using with the file can be searched for details. An index.php file, having a Welcome message, “Welcome to File processing” and two links, “Register” & “Login” taking to register.php and login.php details about which are given below. Write register.php that takes Name, User Name, Password, Mobile number and E-mail id as input. Use HTML 5 validation to ensure all fields are mandatory. Upon submitting the form, these details should be written to a file users.txt in a newline as colon separated values and message “Dear User, Thank you for enrolling.” message should appear for users returning back to index.php. If the file exist append, else create and keep adding. The User name is unique. Ensure the file doesn't have a line containing same user name as the one being added. If user name already exist, Error message “Same User name exist, Try again with a different one.” must come & other than user name and password all other values must be retained back in the form. Write login.php that takes User name and Password as inputs (they are mandatory fields) & when submitted it accesses the file to check is user name exist in lines and if exist the password is right. Hint: Loop through lines, Use explode() to store user name and pass word as an associative array first, Use array_key_exist() to check if user name exist, then compare password If credentials are right then take to a user.php else return to same page displaying error message “Bad Credentials”. The user.php displays a welcome message “Welcome User. Thank you for visiting back.” has a link to profile.php as Profile and password_change.php as Change Password Upon clicking Profile returns fields Name, Mobile number and E-mail ID with their values for the User logged in, read from the file. An update button that will update the corresponding line in the file & return to user.php with success message “Profile successfully updated”. Upon clicking Change Password, will return a form asking for current password & new password and searches the file, verifies that the current password matches and if so updates the line with the new password and returns back to user.php with success message, “Password successfully updated” else returns to password_change.php saying “Current password is wrong”. Hint: Use a hidden field to store User ID after logging in, using with the file can be searched for details