SHARE
TWEET

Untitled

a guest Oct 23rd, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. echo "<h1>Register</h1>";
  3.  
  4. //form data
  5. if($_SERVER['REQUEST_METHOD'] == "POST") //This code works,nothing else does!
  6. {
  7.     $fullname = strip_tags($_POST['fullname']);
  8.     $username = strip_tags($_POST['username']);
  9.     $password = strip_tags($_POST['password']);
  10.     $repeatpassword = strip_tags($_POST['repeatpassword']);
  11.     $email = strip_tags($_POST['email']);
  12.     $steam = strip_tags($_POST['steam']);
  13.     $xfire = strip_tags($_POST['xfire']);
  14.     $date = date("Y-m-d");
  15.  }
  16.  
  17. if($_SERVER['REQUEST_METHOD'] == "POST")
  18. {
  19. //check for existence
  20.     if ($fullname&&$username&&$password&&$repeatpassword&&$email)
  21.     {
  22.         if ($password==$repeatpassword)
  23.         {
  24.             if (strlen($username)>50||(strlen($username)<6))
  25.             {
  26.                 echo "Length of username is too long";
  27.             }
  28.             else
  29.             {
  30.                 if (strlen($password)<6)
  31.                 {
  32.                     echo "Your password must be of 6 or more characters";
  33.                 }
  34.                 else
  35.                 {
  36.                     $password = md5($password);
  37.                     $repeatpassword = md5($repeatpassword);
  38.                     $connect = mysql_connect("localhost","b3fantastico","password");
  39.                     mysql_select_db("phplogin"); //Select Database
  40.                     $queryreg = mysql_query("INSERT INTO users VALUES ('', '$fullname', '$username', '$password', '$email', '$steam', '$xfire', '$date')") or die(mysql_error());
  41.                     die ("You have been registered");
  42.                 }
  43.             }
  44.         }
  45.         else
  46.             echo "Your passwords do not match";
  47.     }
  48.     else
  49.     echo "Please fill in all fields";
  50. }
  51.  
  52.  
  53. ?>
RAW Paste Data
Pastebin PRO Autumn Special!
Get 40% OFF on Pastebin PRO accounts!
Top