Advertisement
Guest User

Untitled

a guest
Jul 27th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?
  2. $userreg=$_POST['user'];
  3. $passreg=$_POST['pass'];
  4.  
  5. //Local Variables
  6. $taken="false";
  7. $database="darkdabu_Tutorial";
  8. $password="loluthought";
  9. $username="darkdabu";
  10.  
  11. //Main Statement
  12. if($userreg&&$passreg){
  13.  
  14. //Connect To Database
  15.       $con = mysql_connect('localhost, $username, $password') or die("Unable to log into database");
  16.  
  17. @mysql_select_db($database, $con) or die ("Unable to Connect to database");
  18.  
  19. mysql_query("INSERT INTO `users` VALUES('', '$userreg', '$userpass')") or die ("Strange Error");
  20.  
  21.  
  22. echo "Account Created";
  23.  
  24. mysql_close($con);
  25.  
  26. header("location:index.html");
  27.  
  28.  
  29. } else {
  30.  
  31. echo "You need to have both a username and password";
  32.  
  33.  
  34.  
  35. }
  36.  
  37.  
  38.  
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement