Advertisement
Guest User

functions.php

a guest
Nov 1st, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1.  
  2.         //protect field against sql injections
  3.         $username = mysqli_real_escape_string($connect, $username);
  4.         $password = mysqli_real_escape_string($connect, $password);
  5.         //encrypt password
  6.         $hashFormat = "$2y$10$";
  7.         $salt = "iusesomecrazystrings222222";
  8.         $hashSalt = $hashFormat . $salt;
  9.         $password = crypt($password, $hashSalt);
  10.        
  11.         $query = "INSERT INTO users(username,password) "
  12.                 . "VALUES ('$username', '$password')";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement