Advertisement
Guest User

Untitled

a guest
Aug 7th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <?php
  2.  
  3. include('config.php');
  4. include('register.php');
  5.  
  6. //test to see if username is alphannumberic
  7. $user=$_POST['useregister'];
  8. $pass=$_POST['passwordregister'];
  9. $conf=$_POST['password'];
  10.  
  11. if ($pass != $conf) {
  12. //pass and confirm don't equal each other
  13. }
  14. if(!preg_match('/[^A-Za-z0-9]/ i' , $test)){
  15.  
  16. //test for duplicate names
  17. $query="SELECT * FROM usernames WHERE username ='$user'";
  18. $result=mysql_query($query);
  19. $num=mysql_num_rows($result);
  20.  
  21. if ($num == 0){
  22.  
  23. //insert users into table
  24. $sql="INSERT INTO users SET useregister = '$user', passwordregister = '$pass'";
  25. $result=mysql_query($sql);
  26.  
  27. //Shows "Thanks for registering" page
  28. header("Location:thanksreg.html");
  29.  
  30.  
  31. }else{
  32. header("Location:nameinuse.html");
  33. }
  34.  
  35. }else{
  36. header("Location:invalidname.html");
  37. }
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement