Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <?php
  2. $host="127.0.0.1";
  3. $port="3308";
  4. $user="user";
  5. $password="pass";
  6. $dbc="trinity_char";
  7.  
  8. $chr = mysql_connect("$host:$port", "$user", "$pass", True);
  9. mysql_selectdb("$dbc", $chr);
  10. $guid = $_POST['guid'];
  11. if($chr)
  12. $name = mysql_query("SELECT name FROM characters WHERE guid=$guid");
  13. else
  14. $name = "error";
  15.  
  16. echo "
  17. <script type=\"text/javascript\">
  18. function isAlphaNumeric(value)
  19. {
  20. if (value.match(/^[0-9]+$/))
  21. return true;
  22. return false;
  23. }
  24. function checkform(f)
  25. {
  26. if (f.guid.value == \"\")
  27. {
  28. alert(\"Введите guid\");
  29. return false;
  30. }
  31. if (!isAlphaNumeric(f.guid.value))
  32. {
  33. alert(\"Запрещенные символы в guid\");
  34. return false;
  35. }
  36. }
  37. </script>";
  38.  
  39. echo "
  40.  
  41. <font color=#00CC00>
  42. </font><br><br>
  43. <center>
  44. <form method=post action=index.php?id=lol onsubmit=\"return checkform(this)\">
  45. <table>
  46. <center>
  47. <tr>
  48. <td colspan=2 style=\"text-align: center;\">$name</td>
  49. </tr>
  50. <tr>
  51. </tr><td><b>*GUID:</b></td>
  52. <td><input type=text name=guid maxlength=10></td>
  53. </tr>
  54. <center>
  55. <tr>
  56. <td colspan=2 style=\"text-align: center;\"><br><input type=submit value=Узнать ник></td>
  57. </tr>
  58. </table>
  59. </form></center>";
  60.  
  61. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement