Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Username = $_POST['Username'];
- $Password= $_POST ['Password'];
- $Name= $_POST ['Name'];
- $Email= $_POST ['E-mail'];
- //Database Query
- $sql = "SELECT Username,Password,user_id FROM users WHERE Username='".$_POST['Username']."' AND Password='".$_POST['Password']."'";
- // select the username and password from the database that matches the data entered in the login form found in $_post
- $result = @mysql_query($sql);
- if ((mysql_num_rows($result)==1)) // if the entry matches user exists
- {
- echo "The login details entered already exist, please login as a existing customer or choose differant details";
- }
- else
- {
- $sql = "INSERT INTO users Name, Username, Password, E-mail) values('". $Username ."','". $Password ."','". $Name ."','".$Email ."')'";
- $result = mysql_query( $sql);
- echo "Thankyou for registering with Ademoimages"; //else insert new customers details into tblusers
- }
- ?>
- <form action='' method='post'> <!-- post the users login details to the server database when the login button is clicked -->
- Name <input type='text' Name='Your Name'>
- Username <input type='text' name='Username'/>
- E-mail <input type'text' name ='E-mail'/>
- Password <input type='password' name='Password' />
- <input type='submit' value='Register'>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement