Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. Index page
  2. -------------------------
  3. <html>
  4. <head>
  5. <title>MPGH Story</title>
  6. <!--- By KushxOrangeJuice ---!>
  7. <style>
  8. *{ FONT-SIZE: 8pt; FONT-FAMILY: verdana; } b { FONT-WEIGHT: bold; } .listtitle { BACKGROUND: #425984; COLOR: #EEEEEE; white-space: nowrap; } td.list { BACKGROUND: #EEEEEE; white-space: nowrap; } </style>
  9. </head>
  10. <center><br><br><br><br>
  11. <h1>MPGH Story</h1>
  12. <table cellspacing=1 cellpadding=5>
  13. <tr>
  14. <td class=listtitle colspan=2>AmoraMS</td></tr>
  15. <form action="register_do.php" method="POST">
  16. <tr><td class=list align=right>Username:</td><td class=list><input type=text name=name maxlength="30"></td></tr>
  17. <tr><td class=list align=right>Password:</td><td class=list><input type=password name=pass maxlength="30"></td></tr>
  18. <tr><td class=listtitle align=right colspan=2><input type=submit name=submit value='Register'></td><?php include("total.php");?><?php include("status.php");?></tr>
  19. </form>
  20. </table>
  21. </center></body></html>
  22. -------------------------
  23.  
  24. Registry Action Page
  25. ---------------------
  26. <?php
  27. print '<title>MPGH Story</title>';
  28. $name = $_POST['name'];
  29. $pass = $_POST['pass'];
  30.  
  31.  
  32. $host['naam'] = 'localhost'; // my host
  33. $host['gebruikersnaam'] = 'root'; // my database username
  34. $host['wachtwoord'] = 'skyjack'; // my database password
  35. $host['databasenaam'] = 'odinms'; // my database name
  36.  
  37. $db = mysql_connect($host['naam'], $host['gebruikersnaam'], $host['wachtwoord']) OR die ('Cant connect to the database');
  38. mysql_select_db($host['databasenaam'], $db);
  39.  
  40. $sel = 'SELECT count(*) FROM users WHERE username="'.$_POST['name'].'"';
  41. if($name == ""){
  42. echo 'No username filled in';
  43. exit();
  44. ‎$c1 = mysql_query($sel);
  45. $c2 = mysql_fetch_array($c1);
  46. }elseif($c2['0'] >= 1 ){
  47. echo 'This username does already exists!';
  48. exit();
  49. }elseif($pass == ""){
  50. echo 'No password filled in';
  51. exit();
  52. }else{
  53. $d = 'INSERT INTO users (username, password, pin, gender, GM) VALUES ("'.$name.'", "'.$pass.'", "0", "0","0")';
  54. mysql_query($d) OR die (mysql_error());
  55. echo 'Your account has been created, you can now login.';
  56. }
  57. ?>
  58. ---------------------
  59.  
  60. Server status it shows up on the bottom of the page this script is fine though runs perfect.
  61. ---------------------
  62.  
  63. Idk what page this is for but this is where i get all the errors
  64. ------------------
  65. <?php
  66. $host['naam'] = 'localhost'; // my host
  67. $host['gebruikersnaam'] = 'root'; // my database username
  68. $host['wachtwoord'] = 'skyjack'; // my database password
  69. $host['databasenaam'] = 'odinms'; // my database name
  70.  
  71. $db = mysql_connect($host['naam'], $host['gebruikersnaam'], $host['wachtwoord']) OR die ('Cant connect to the database');
  72. mysql_select_db($host['databasenaam'], $db);
  73.  
  74. $result1 = mysql_query("SELECT count(*) FROM users", $db);// Account section
  75. $num_rows = mysql_fetch_array($result1);
  76.  
  77. echo $num_rows['0'] . "Accounts\n";
  78.  
  79. $result = mysql_query("SELECT count(*) FROM characters", $db);// Character section
  80. $num_rowsc = mysql_fetch_array($result);
  81. echo $num_rowsc['0'] . " Characters\n";
  82.  
  83. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement