daily pastebin goal
35%
SHARE
TWEET

Untitled

a guest Jun 18th, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     include ('encrypt.php');
  3.     include('connect.php');
  4.    
  5.     $user = mysql_real_escape_string($_POST['name']);
  6.     $pass = mysql_real_escape_string($_POST['pass']);
  7.     $confirm = mysql_real_escape_string($_POST['confirm']);
  8.    
  9.     if ($_POST['name']== "" || $_POST['pass']== "" || $_POST['confirm']== "")
  10.     {
  11.         header("Location: error1.php");
  12.     }
  13.     if ($pass != $confirm)
  14.     {
  15.         header("Location: error2.php");
  16.     }
  17.     $result = mysql_query("SELECT login FROM accounts WHERE login=);
  18. if(mysql_num_rows($result)>0) {
  19. die ('Error: Username already exists.');
  20. }else{
  21. mysql_query("INSERT INTO accounts (login, password, access_level) VALUES ('".$_POST['name']."', '".base64_encode(pack('H*', sha1($_POST['pass'])))."', 0)")
  22. or die ('Error: ' . mysql_error());
  23. }
  24.  
  25. //report successful registration
  26. echo "Account created successfully.";
  27. ?>
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