Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('config.php');
- include('register.php');
- //test to see if username is alphannumberic
- $user=$_POST['useregister'];
- $pass=$_POST['passwordregister'];
- $conf=$_POST['password'];
- if ($pass != $conf) {
- //pass and confirm don't equal each other
- }
- if(!preg_match('/[^A-Za-z0-9]/ i' , $test)){
- //test for duplicate names
- $query="SELECT * FROM usernames WHERE username ='$user'";
- $result=mysql_query($query);
- $num=mysql_num_rows($result);
- if ($num == 0){
- //insert users into table
- $sql="INSERT INTO users SET useregister = '$user', passwordregister = '$pass'";
- $result=mysql_query($sql);
- //Shows "Thanks for registering" page
- header("Location:thanksreg.html");
- }else{
- header("Location:nameinuse.html");
- }
- }else{
- header("Location:invalidname.html");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement