Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4.  
  5. if($a == "")
  6. {
  7. ?>
  8. <form action="" method="post">
  9. Username: <input type="text" name="username" size="30"/><br>
  10. Password: <input type="password" name="password" size="30"/><br>
  11. E-mail: <input type="password" name="email" size="50"/><br>
  12. <input type="hidden" name="a" value="1"><br>
  13. <input type="submit" />
  14. </form>
  15.  
  16. <?php
  17. }
  18. else
  19. {
  20. $username = $_POST['username'];
  21. $password = $_POST['password'];
  22. $email = $_POST['email'];
  23.  
  24. //Fill in database details here
  25. $dbhost = "";
  26. $dbuser = "";
  27. $dbpass = "";
  28. $dbname = "";
  29.  
  30. mysql_connect ($dbhost, $dbuser, $dbpass)or die("ERROR: Could not connect: ".mysql_error());
  31. mysql_select_db($dbname) or die(mysql_error());
  32.  
  33. mysql_query("INSERT INTO users (username, password, email)
  34. VALUES ('$postname', '$username', '$password', '$email')");
  35.  
  36. echo "Successfully Joined!";
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement