Advertisement
Guest User

Untitled

a guest
May 29th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.99 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.  
  14. mysql_select_db("freelobby", $con);
  15.  
  16.  
  17. $ip=$_SERVER["REMOTE_ADDR"];
  18. $gamertag=$_POST["gamertag"];
  19. $alias=$_POST["alias"];
  20.  
  21. echo "$gamertag";
  22. echo "<br>";
  23. echo "$alias";
  24. echo "<br>";
  25. echo "$ip";
  26. echo "<br>";
  27.  
  28. // Checking the gamertag
  29. $buscarusuario = "SELECT * FROM lobby WHERE gamertag = '$gamertag'";
  30. $resultadouser = mysql_query($buscarusuario);
  31.  
  32. if (mysql_num_rows($resultadouser) > 0){
  33. echo "This gamertag has already been registerd.<br> ";
  34. echo("Registration not completed.<br>");
  35. }
  36. else
  37. {
  38.  
  39. // Checking the alias
  40. $buscarusuario1 = "SELECT * FROM lobby WHERE alias = '$alias'";
  41. $resultadouser1 = mysql_query($buscarusuario1);
  42.  
  43. if (mysql_num_rows($resultadouser1) > 0){
  44. echo "This alias has already been registerd.<br> ";
  45. echo("Registration not completed.<br>");
  46.  
  47. }
  48. else
  49. {
  50. echo "alias in use";
  51. }
  52. ?>
  53.  
  54.  
  55. </body>
  56. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement