Advertisement
Guest User

Untitled

a guest
Jan 6th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <html>
  2. <body>
  3. <h1>User Creation</h1>
  4. <?php
  5. session_start();
  6. if($_SESSION['login'] != "OK")
  7. {
  8. header('Location: login.php');
  9. exit();
  10. }
  11. $new_user = $_POST["new_username"];
  12. $new_pass = $_POST["new_password"];
  13. $new_first = $_POST["new_firstname"];
  14. $new_last = $_POST["new_surname"];
  15. include_once("connection/conn.php");
  16.  
  17. $sql = "INSERT INTO Users (Loginname, Password, Firstname, Surname) VALUES ('$new_user','$new_pass','$new_first','$new_last')";
  18. mysql_query($sql,$conn) or die ("User creation failed.");
  19. echo "<p>User created successfully.</p>";
  20. echo "<p>Return to <ahref='protected.php'>application</a> or <a href='login.php'>log out</a></p>";
  21. ?>
  22. </body>
  23. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement