daily pastebin goal
29%
SHARE
TWEET

Untitled

a guest Dec 23rd, 2017 235 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.         //Check name for dupese
  19.             $namecheck = mysql_query("SELECT username FROM userinfo WHERE username='$username'");
  20.             $count = mysql_num_rows($namecheck);
  21.            
  22.             if ($count != 0)
  23.             {
  24.                 echo "The username is already taken."<
  25.             }
  26.         else {
  27.             $query = "INSERT INTO userinfo (userid, username, firstname, lastname, password) VALUES ('','$username', '$firstname', '$lastname', '$security')";
  28.             $result = mysql_query($query);
  29.             mkdir("users/". $username ."", 0777);          
  30.             echo "Welcome to the community, $username!";
  31.         }
  32.     }
  33.     else { echo "Something went wrong! Make sure you entered your name and password(and confirm).. Thats all we know."; }
  34.  
  35. ?>
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