Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('../private/config.php/');
- include('../register/');
- //test to see if username is alphannumberic
- $user=$_POST['useregister'];
- $pass=$_POST['passwordregister'];
- $conf=$_POST['pass2'];
- 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 username = '$user', password = '$passwordregister'";
- $result=mysql_query($sql);
- //Shows "Thanks for registering" page
- header("Location:../thanksreg/");
- }else{
- header("Location:../nameinuse/");
- }
- }else{
- header("Location:../invalidname/");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement