Advertisement
Guest User

Untitled

a guest
Jul 11th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. <?php
  2. include('connect.php')//check
  3.  
  4. //set variable
  5. $passkey=$_GET['passkey'];
  6.  
  7. $sql1="SELECT * FROM temp WHERE code='$passkey'";
  8. $result1=mysql_query($sql1);
  9.  
  10. //if sucessfully queried
  11. if($result1){
  12.  
  13. //how many rows have key
  14. $count=mysql_num_rows($result1);
  15.  
  16. //if passkey in database, retrieve data
  17. if($count==1){
  18.  
  19. $rows=mysql_fetch_array($result1);
  20. $namex=$rows['username'];
  21. $emailx=$rows['email'];
  22. $passwordx=$rows['password'];
  23.  
  24. //takeoutspace
  25. $name=str_replace(' ','',$namex);
  26. $email=str_replace(' ','',$emailx);
  27. $passwoed=str_replace(' ','',$passwordx);
  28.  
  29. //insert into users table
  30. $sql2="INSERT INTO game SET username='$name', email='$email='$email', password='$password'";
  31. $result2=mysql_query($sql2);
  32.  
  33. //gamestats table
  34. $sql3="INSERT into gamestats SET username='$name'";//finish!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  35. $result3=mysql_query($sql3);
  36.  
  37. }else{
  38. echo "wrong confirmation code";
  39. }
  40.  
  41. if($result2){
  42. header("location:confirmation2.html");
  43.  
  44. //remove from temp
  45. $sql5="DELETE FROM temp WHERE code='$passkey'";
  46. $result 5=mysql_query($sql5);
  47. }
  48.  
  49. }
  50.  
  51.  
  52. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement