Here it is - I hope you can answer this easily. I would like to setup the following sequence using PHP and mySQL
1) The user first selects to create a 'New Account' (no worries on the script for this step (html), I simply need help on the PHP side)
2) After the user selects 'New Account' they receive the following message:
Please first select a Username to see if it is available
Here is the first PHP script - I would like the script to go back to the mySQL DB and see if any of the 'username' fields have the same variable as the one they just entered ($username). The reason is simple, before a user sets up a New Account with a new username, I would like to check first to see if the username is already in use.
3) As the PHP script is checking the mySQL database to see if this unique username already exists, it either does one of two events:
A) If the username is already in use, the PHP script does something like the following:
if (username exists) then tell the header to goto {header("Location: exists.htm"); exit;}
B) If the username is available, the PHP script does something like the following:
if (username available) then tell the header to goto {header("Location: available.htm"); exit;}
4) If the username is available, I will send the user to a new screen (available.htm) where they will input the following fields:
Username
First Name
Last Name
Passsword
Title
Email Adress
Phone Number
Address
5) After these fields are entered, I would like the PHP script to open up mySQL again and create these fields under the unique username they just entered in the previous step (I would like the PHP script setup to allow multiple users to create new accounts under new usernames).
FINAL STEPS
6) Upon loging into the site on future visits, I would like the PHP script to now check the username and password to see if they match and are valid. If they are valid do A and if they are not do B below:
A) if (valid) then tell the header to goto {header("Location: valid.htm"); exit;}
B) if (not valid) then tell the header to goto {header("Location: not_valid.htm"); exit;}
7) Once a user has setup a new account under a unique username, I would like a PHP script to allow the user to 'edit' their profile, thus the script would search for the unique username in the mySQL DB and send back all the variables (please see #4 above) associated with this username for editing. Once the changes are made to these variables, the PHP script would then send back the updates to mySQL (like a new updated email address or title, etc).
Thanks for the help and the points are yours!!!
Start Free Trial