Advertisement
Guest User

Untitled

a guest
Aug 9th, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.16 KB | None | 0 0
  1. <?php
  2. include "connect.php";
  3. $user=$_POST['username'];
  4. $password=$_POST['password'];
  5. $confirm=$_POST['confirm'];
  6. $user=strip_tags($user);
  7. if ($password==$confirm)
  8. {
  9.  
  10.   $isuser="SELECT * from USER TABLE where username='$user'";                  //CHECK IF THE NAME ALREADY EXISTS YO!
  11.   $isuser2=mysql_query($isuser) or die("Could not query users table" . mysql_error());
  12.   $isuser3=mysql_fetch_array($isuser2);
  13.   if(!$_POST['password'] || !$_POST['confirm'])
  14.   {
  15.      print "You did not enter a password faggot..";
  16.   }
  17.   else if($isuser3 || strlen($user)>15 || strlen($user)<1)
  18.   {
  19.      print "Either, that user exists or you entered a name below 1 character or above 15.";
  20.   }
  21.   else
  22.   {
  23.       $password=md5($password);
  24.       $SQL = "INSERT into USER TABLE(username, password, OTHER FIELD NAMES) VALUES ('$user','$password', 'OTHER VALUES')";
  25.       mysql_query($SQL) or die("Couldn't register" . mysql_error());
  26.       print "Rocketttttt Success. You can now buy an amazing CD! <br />";
  27.       print "Click here to <a href='login.php'>Login</a>";
  28.   }
  29. }
  30.  
  31. else
  32. {
  33.   print "Rockettttttt Wrong, your passwords didn't match or you did not enter a password.";
  34. }
  35. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement