Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1.  
  2. if(isset($_POST)
  3. {
  4. $username = mysqli_real_escape_string(stripslashes(htmlspecialchars($_POST["username"])));
  5. $password = mysqli_real_escape_string(stripslashes(htmlspecialchars(sha1($_POST["password"]))));
  6. $q = "SELECT * FROM user WHERE username = '$username' AND password = '$password' ";
  7. $r = mysqli_query($dbc, $q);
  8. if (mysqli_num_rows($r)==1)
  9. {
  10. $_SESSION['user_name'] = $_POST['username'];
  11. header('location:reg1.php');
  12. }
  13. else
  14. {
  15. echo 'error again!'.mysqli_error($dbc);
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement