daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 134 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. function addUser($login, $pass, $email, $ip) {
  3.     $one = 0;
  4.     echo "login" . $login . $pass . $email . "<br/>";
  5.     if(strlen($login) < 6) {
  6.             echo "Zbyt krótki login (minimum 6 znaków)<br />";
  7.             $one = 1;
  8.     }
  9.     if(strlen($pass) < 6) {
  10.             echo "Zbyt krótkie hasło (minimum 6 znaków)<br />";
  11.             $one = 1;
  12.     }
  13.     if(!preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/" , $email)) {
  14.             echo "Nieprawidłowy email<br />";
  15.             $one = 1;
  16.     }
  17.     if($one = 0) {
  18.             $login = htmlspecialchars($login);
  19.             $login = addslashes($login);
  20.             $pass = htmlspecialchars($pass);
  21.             $pass = addslashes($pass);
  22.             $password = sha1(md5($pass));
  23.             $insert = "INSERT INTO users(login, password, email, ip) VALUES('$login, '$password', '$email', '$ip')";
  24.             mysql_query($insert) or die(mysql_error());
  25.             echo "Zostałeś zarejestrowany, możesz się teraz zalogować.";
  26.     }
  27. }
  28. ?>
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