Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("connection.php");
- $mypass = crypt($_POST['pass'], '$2a$07$usesomesillystringforsalt$');
- $user=$_POST['user'];
- $sql = $dbh->prepare("SELECT id FROM `users` WHERE pass=?");
- $dbh->beginTransaction();
- $sql->execute(array($mypass));
- $dbh->commit();
- $count=$sql->rowCount($sql);
- echo $count;
- echo $mypass;
- if($count==1){
- $_SESSION['user']=$user;
- $_SESSION['logged_in']=true;
- echo '<META HTTP-EQUIV="Refresh" Content="0; URL=index.php">';
- } else {
- $_SESSION['logged']="fail";
- echo '<META HTTP-EQUIV="Refresh" Content="2; URL=index.php">';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement