Advertisement
Guest User

omfg HEEELP MEEEEEEEEEE

a guest
Aug 6th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11. REGISTER.PHP:
  12. <html>
  13. <head>
  14.  
  15. <link rel="stylesheet" type="text/css" href="main.css">
  16.  
  17.  
  18.  
  19. <?php
  20. require('connection.php');
  21. // If the values are posted, insert them into the database.
  22. if (isset($_POST['username']) && isset($_POST['password'])){
  23. $username = $_POST['username'];
  24. $email = $_POST['email'];
  25. $password = $_POST['password'];
  26.  
  27. $query = "INSERT INTO `accounts information` (username, password, email) VALUES ('$username', '$password', '$email')";
  28. $result = mysql_query($query);
  29. if($result){
  30. $msg = "User Created Successfully.";
  31. }
  32. }
  33. ?>
  34. </head>
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. <body>
  42.  
  43. <div class="register-form">
  44.  
  45. <h1>Register</h1>
  46.  
  47. <form action="" method="POST">
  48.  
  49. <p><label>User Name : </label>
  50.  
  51. <input id="username" type="text" name="username" placeholder="username" /></p>
  52.  
  53.  
  54.  
  55. <p><label>E-Mail&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : </label>
  56.  
  57. <input id="password" type="email" name="email"/></p>
  58.  
  59.  
  60.  
  61. <p><label>Password&nbsp;&nbsp; : </label>
  62.  
  63. <input id="password" type="password" name="password" placeholder="password" /></p>
  64.  
  65.  
  66. <a class="btn" href="login.php">Login</a>
  67.  
  68. <input class="btn register" type="submit" name="submit" value="Register" />
  69.  
  70. </form>
  71.  
  72. </div>
  73.  
  74.  
  75.  
  76. </body>
  77. </html>
  78.  
  79.  
  80. MAIN.CSS:
  81.  
  82. margin: 0 auto;
  83.  
  84. text-align: center;
  85.  
  86. padding: 10px;
  87.  
  88. color: #fff;
  89.  
  90. background : #c4c4c4;
  91.  
  92. border-radius: 10px;
  93.  
  94. -webkit-border-radius:10px;
  95.  
  96. -moz-border-radius:10px;
  97.  
  98. }
  99.  
  100.  
  101.  
  102. register-form form input{padding: 5px;}
  103.  
  104. register-form.btn{background: #726E6E;
  105. 15
  106. padding: 7px;
  107. 16
  108. border-radius: 5px;
  109. 17
  110. text-decoration: none;
  111. 18
  112. width: 50px;
  113. 19
  114. display: inline-block;
  115. 20
  116. color: #FFF;}
  117.  
  118.  
  119.  
  120. register-form .register{
  121. 23
  122. border: 0;
  123. 24
  124. width: 60px;
  125. 25
  126. padding: 8px;
  127. 26
  128. }
  129.  
  130.  
  131.  
  132. CONNECTION.PHP:
  133. <?php
  134. $connection = mysql_connect('localhost', 'root', 'password');
  135. if (!$connection){
  136. die("Database Connection Failed" . mysql_error());
  137. }
  138. $select_db = mysql_select_db('login.');
  139. if (!$select_db){
  140. die("Database Selection Failed" . mysql_error());
  141. }
  142. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement