Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'global.php';
- if ($_POST['register']){
- //get form data
- $username = addslashes(strip_tags($_POST['username']));
- $password = addslashes(strip_tags($_POST['password']));
- $email = addslashes(strip_tags($_POST['email']));
- if (!$username||!$password||!$email)
- echo "Please fill out all of the required fields!";
- else{
- //encrypt password
- $password = md5($password);
- //check if username already taken
- $check = mysql_query("SELECT * FROM admin WHERE username='$username'");
- if (mysql_num_rows($check) >= 1)
- echo "Sorry, that username is already taken!";
- else {
- //register into database
- $register = mysql_query("INSERT INTO admin VALUES ('','$username','$password','$email')") or die(mysql_error());
- echo "Thanks for registering!";
- }
- }
- }
- else{
- ?>
- ***Right here is there the main part of the website goes, like, username, password, and email***
- <?php
- }
- ?>
- $register = mysql_query("INSERT INTO admin VALUES ('$username','$password','$email', '', '', '', '', '', '', '')") or die(mysql_error());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement