Advertisement
Guest User

Untitled

a guest
May 29th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <html>
  2. <body>
  3.  
  4. <?php
  5.  
  6.  
  7.  
  8. $con = mysql_connect("127.0.0.1","root","root");
  9. if (!$con)
  10. {
  11. die('Could not connect: ' . mysql_error());
  12. }
  13. $ip=$_SERVER["REMOTE_ADDR"];
  14. $gamertag=$_POST["gamertag"];
  15. $alias=$_POST["alias"];
  16.  
  17. $sql = "SELECT gamertag FROM lobby WHERE gamertag = '$gamertag'";
  18.  
  19. echo "$gamertag";
  20. echo "<br>";
  21. echo "$alias";
  22. echo "<br>";
  23. echo "$ip";
  24. echo "<br>";
  25.  
  26. // Checking the Username
  27. $buscarusuario = "SELECT gamertag FROM lobby WHERE gamertag LIKE '$gamertag'";
  28. $resultadouser = mysql_query($buscarusuario);
  29.  
  30. if (mysql_num_rows($resultadouser) > 0){
  31. echo "Username you've entered already taken.<br> ";
  32. echo("Registration not completed.<br>");
  33. }
  34.  
  35.  
  36. $result = mysql_query($sql);
  37.  
  38. if(mysql_num_rows($result) == 1) {
  39. echo 'a row has been found';
  40. } else {
  41. echo 'no rows were returned';
  42. }
  43.  
  44.  
  45.  
  46. ?>
  47.  
  48.  
  49. </body>
  50. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement