Advertisement
HelloDearSir

Untitled

Mar 4th, 2019
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. <?php
  2. //When the user has been created,it wil be put onto the database, so new users can look onto the website, it will also connects to the database so it can put the new users and passwords onto the database.
  3. if(isset($_POST["username"])){
  4. $new_user = $_POST["username"];
  5. $new_pass = $_POST["password"];
  6.  
  7.  
  8. $connect = mysqli_connect("localhost", "root", "root") or die("summut gungan rong");
  9. $conn = mysql_connect ("localhost", "root", "root") or die ("Sorry can't connect to MySQL database");
  10. $Database = mysql_select_db ("c9", $conn) or die ("error");
  11. $insert = "INSERT INTO Users(Username, Password)
  12. VALUES ('$new_user', '$new_pass')";
  13. if(mysql_query($insert, $conn)){
  14. session_destroy();
  15. header("Location: login.php");
  16. }
  17. }
  18. ?>
  19. <html>
  20. <head> <link rel="stylesheet" a href="css/sign_up.css"> Top_left Design</head>
  21. <body>
  22. <ul>
  23. <li style="float:right" ><a href="index.php">Home</a></li>
  24. <li style="float:right" ><a href="FAQ.html">FAQ</a></li>
  25. <li><a href="login.php">Log In</a></li>
  26. <li><a href="sign_up.php">Register </a></li>
  27. <li><a href="uplaod.html">Profile</a></li>
  28. <li style="float:right" ><a href="https://docs.google.com/forms/d/e/1FAIpQLSfaORAYIOlYxE3lXU6CdnVpHUQOZFCQZmoKq18qKU_6O8FizA/viewform?usp=sf_link">FeedBack Form </a></li>
  29. </ul>
  30.  
  31.  
  32.  
  33. <body>
  34.  
  35. <div class="login">
  36. <form action="sign_up.php" method="post">
  37. <table>
  38. <tr>
  39. <td align= "right">
  40. Username:
  41. </td>
  42. <td>
  43. <input size="20px" size="20px" maxlengh="15" type="text" name="username" required>
  44. </td>
  45. </tr>
  46. <tr>
  47. <td align = "right">
  48. Password:
  49. </td>
  50. <td>
  51. <input size="20px" type="password" size="20px" maxlengh="15" name="password">&nbsp;
  52.  
  53. </td>
  54.  
  55. </tr>
  56. <td>
  57. <input type="submit" value="register">
  58. </td>
  59. </form>
  60. </table>
  61.  
  62. </div>
  63. </body>
  64.  
  65. </body>
  66. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement