daily pastebin goal
34%
SHARE
TWEET

Untitled

a guest Dec 23rd, 2017 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3.     include 'config.php';
  4.  
  5.     $username = $_POST['username'];
  6.     $username = mysql_real_escape_string($username);
  7.    
  8.     $firstname = $_POST['firstname'];
  9.     $lastname = $_POST['lastname'];
  10.    
  11.     $password = $_POST['password'];
  12.     $password = mysql_real_escape_string($password);
  13.        
  14.     $security = md5("$password");
  15.    
  16.     if ($_POST['submit']&&$username&&$password&&$firstname&&$lastname)
  17.     {
  18.         $user_check = "SELECT * FROM userinfo WHERE username='$username'";
  19.         $user_num = num_rows($user_check)
  20.         if ($user_num!=1){
  21.             echo "Sorry, this username is already taken.";
  22.         }
  23.         else {
  24.             $query = "INSERT INTO userinfo (userid, username, firstname, lastname, password) VALUES ('','$username', '$firstname', '$lastname', '$security')";
  25.             $result = mysql_query($query);
  26.             mkdir("users/$username/", 0700);
  27.            
  28.             echo "Welcome to the community, $username!";
  29.         }
  30.     }
  31.     else { echo "Something went wrong! Make sure you entered your name and password(and confirm).. Thats all we know."; }
  32.  
  33. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top