Advertisement
Guest User

Untitled

a guest
Sep 26th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 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 * FROM users WHERE username="'.$_POST['name'].'"';
  41. if($name == ""){
  42. echo 'No username filled in';
  43. exit();
  44. }elseif(mysql_num_rows(mysql_query($sel)) >= 1 ){
  45. echo 'This username does already exists!';
  46. exit();
  47. }elseif($pass == ""){
  48. echo 'No password filled in';
  49. exit();
  50. }else{
  51. $d = 'INSERT INTO users (username, password, pin, gender, GM) VALUES ("'.$name.'", "'.$pass.'", "0", "0","0")';
  52. mysql_query($d) OR die (mysql_error());
  53. echo 'Your account has been created, you can now login.';
  54. }
  55. ?>
  56. ---------------------
  57.  
  58. Server status it shows up on the bottom of the page this script is fine though runs perfect.
  59. ---------------------
  60.  
  61. Idk what page this is for but this is where i get all the errors
  62. ------------------
  63. <?php
  64. $host['naam'] = 'localhost'; // my host
  65. $host['gebruikersnaam'] = 'root'; // my database username
  66. $host['wachtwoord'] = 'skyjack'; // my database password
  67. $host['databasenaam'] = 'odinms'; // my database name
  68.  
  69. $db = mysql_connect($host['naam'], $host['gebruikersnaam'], $host['wachtwoord']) OR die ('Cant connect to the database');
  70. mysql_select_db($host['databasenaam'], $db);
  71.  
  72. $result = mysql_query("SELECT * FROM users", $db);// Account section
  73. $num_rows = mysql_num_rows($result);
  74.  
  75. echo "$num_rows Accounts\n";
  76.  
  77. $result = mysql_query("SELECT * FROM characters", $db);// Character section
  78. $num_rowsc = mysql_num_rows($result);
  79. echo " $num_rowsc Characters\n";
  80.  
  81. ?>
  82. ------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement