Advertisement
Guest User

Untitled

a guest
Sep 25th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.57 KB | None | 0 0
  1. <?
  2.  
  3. // Config vars
  4. include("../config/config.php");
  5.  
  6. // Variables
  7. $register = $_POST["Submit"];
  8. $user = $_POST["Username"];
  9. $pass = $_POST["Password"];
  10. $repass = $_POST["RepeatPassword"];
  11. $email = $_POST["Email"];
  12. $page = [
  13. '
  14. <!DOCTYPE html>
  15. <html lang="en">
  16.  
  17. <head>
  18. <meta charset="utf-8">
  19. <title>Wizguin - Register</title>
  20. <link rel="shortcut icon" href="assets/favicon-magic.ico">
  21. <meta name="viewport" content="width=device-width, initial-scale=1">
  22. <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" media="screen">
  23. <link rel="stylesheet" href="fontawesome/css/font-awesome.min.css">
  24. <link rel="stylesheet" href="css/hover-min.css">
  25. <link rel="stylesheet" href="css/styles.css">
  26. <link rel="stylesheet" href="css/register.css">
  27. </head>
  28.  
  29. <body>
  30. <div class="navbar navbar-default">
  31. <div class="container">
  32. <div class="navbar-header">
  33. <a class="navbar-brand">Wizguin</a>
  34. <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main">
  35. <span class="icon-bar"></span>
  36. <span class="icon-bar"></span>
  37. <span class="icon-bar"></span>
  38. </button>
  39. </div>
  40. <div class="navbar-collapse collapse" id="navbar-main">
  41. <ul class="nav navbar-nav navbar-right">
  42. <li>
  43. <a href="index.html">Home</a>
  44. </li>
  45. <li>
  46. <a href="play.html">Play</a>
  47. </li>
  48. <li class="active">
  49. <a href="register.html">Register</a>
  50. </li>
  51. <li>
  52. <a href="account.html">Account</a>
  53. </li>
  54. <li>
  55. <a href="highscores.html">Highscores</a>
  56. </li>
  57. <li>
  58. <a href="blog.html">Blog</a>
  59. </li>
  60. </ul>
  61. </div>
  62. </div>
  63. </div>
  64.  
  65. <div class="container register">
  66. <div class="well bs-component">
  67. <form class="form-horizontal" action="php/register.php" method="POST">
  68. <fieldset>
  69. <legend>
  70. Register
  71. <h5>Create a new account</h5>
  72. </legend>
  73. <div class="form-group">
  74. <div class="input-group">
  75. <span class="input-group-addon icon"><i class="fa fa-user"></i></span>
  76. <div class="col-lg-12">
  77. <input type="text" class="form-control" name="Username" placeholder="Username" required>
  78. </div>
  79. </div>
  80. </div>
  81. <div class="form-group">
  82. <div class="input-group">
  83. <span class="input-group-addon icon"><i class="fa fa-envelope"></i></span>
  84. <div class="col-lg-12">
  85. <input type="email" class="form-control" name="Email" placeholder="Email" required>
  86. </div>
  87. </div>
  88. </div>
  89. <div class="form-group">
  90. <div class="input-group">
  91. <span class="input-group-addon icon"><i class="fa fa-lock"></i></span>
  92. <div class="col-lg-12">
  93. <input type="password" class="form-control" name="Password" placeholder="Password" required>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="form-group">
  98. <div class="input-group">
  99. <span class="input-group-addon icon"><i class="fa fa-lock"></i></span>
  100. <div class="col-lg-12">
  101. <input type="password" class="form-control" name="RepeatPassword" placeholder="Repeat Password" required>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="form-group">
  106. <div class="col-lg-10 col-lg-offset-2">
  107. <button type="submit" class="btn btn-primary" name="Submit">Create penguin</button>
  108. </div>
  109. </div>
  110. </fieldset>
  111. </form>
  112. </div>
  113. </div>
  114. <div class="footer-container">
  115. <div class="footer-top" id="footer-scroll">
  116. <div class="container">
  117. <div class="col-md-6">
  118. <h3>Latest News</h3>
  119. <a href="blog.html#5">Game Release</a>
  120. <a href="blog.html#4">Latest News 2</a>
  121. <a href="blog.html#3">Latest News 3</a>
  122. <a href="blog.html#2">Latest News 4</a>
  123. </div>
  124. <div class="col-md-6">
  125. <h3>Recent Tweets</h3>
  126. <a href="#" class="tweet">@wizguin New Website Theme</a>
  127. <a class="tweet-date">9 September 2016</a>
  128. <a href="#" class="tweet">@wizguin New Website Theme</a>
  129. <a class="tweet-date">9 September 2016</a>
  130. </div>
  131. </div>
  132. </div>
  133. <div class="container footer">
  134. Wizguin ©
  135. <div style="float:right;">Some rights reserved to Disney, Club Penguin™</div>
  136. </div>
  137. </div>
  138.  
  139. </body>
  140.  
  141. </html>'
  142. ];
  143.  
  144. echo $page;
  145.  
  146. # If the "CREATE PENGUIN" button was pressed
  147. if(isset($register)) {
  148.  
  149. mysql_connect($server, $username, $password);
  150.  
  151. # If the connection fails
  152. if(!$conn) {
  153. die("Failed to connect to the server: " . mysql_error());
  154. }
  155.  
  156. # Queries for an existing name, to prevent over-write
  157. $res = mysql_db_query("wizguin", 'SELECT Username FROM users WHERE Username="' . $user . '"');
  158.  
  159. # If name exists in SQL
  160. if(mysql_num_rows($res) != 0) {
  161. die("That username already exists.");
  162. }
  163.  
  164. # If the password and repeated are the same
  165. if($pass == $repass) {
  166. # If the passwords are 4-30
  167. if(strlen($pass) >= 4 && strlen($pass) <= 30) {
  168. # If the username is 4-12
  169. if(strlen($user) >= 4 && strlen($user) <= 12) {
  170. mysql_db_query("wizguin", 'INSERT INTO users (Username, Password, LoginKey, RegisteredTime, Buddies, Ignores, Inventory) VALUES ("' . $user . '", "' . $pass . '", "' . rand(0, 10000000) . 'oi", "' . time() . '", "[[]]", "[]", "["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","413"]")');
  171. mysql_close();
  172. echo '<meta http-equiv="refresh" content="0; url=http://wizguin.byethost3.com/register.html?acc=1" />';
  173. }
  174. else echo "Username is too long/short";
  175. }
  176. else echo "Passwords are too long/short";
  177. }
  178.  
  179. # If the password and repeated aren't the same
  180. if($pass != $repass) {
  181. mysql_close();
  182. die("Both passwords to not match.");
  183. }
  184. }
  185.  
  186. mysql_close();
  187. else echo '<meta http-equiv="refresh" content="0; url=http://wizguin.byethost3.com/register.html" />';
  188.  
  189. ?>
  190.  
  191. avdverb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement