Advertisement
redsquirrelstudio

Create account

Dec 31st, 2019
9,208
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. <?php
  2.  
  3.   include('includes/config.php');
  4.  
  5.   $email = $con -> real_escape_string($_GET["email"]);
  6.   $password = $con -> real_escape_string($_GET["password"]);
  7.   $name = $con -> real_escape_string($_GET["name"]);
  8.   $username = $con -> real_escape_string($_GET["username"]);
  9.  
  10.   if (!isset($email)) {
  11.     echo "email not set.";
  12.     die();
  13.   }
  14.   if (!isset($password)) {
  15.     echo "password not set.";
  16.     die();
  17.   }
  18.   if (!isset($name)) {
  19.     echo "name not set.";
  20.     die();
  21.   }
  22.   if (!isset($username)) {
  23.     echo "username not set.";
  24.     die();
  25.   }
  26.  
  27.   $encrypted = sha1($password.$name.$email);
  28.  
  29.   $sql = "INSERT INTO users (email, password, name, username) VALUES ('$email', '$encrypted', '$name', '$username')";
  30.  
  31.   if ($con->query($sql)) {
  32.       echo "success";
  33.   } else {
  34.       echo "failed";
  35.   }
  36.   exit;
  37.  
  38.   $con->close();
  39. ?>
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement