Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['btnok'])) {
- $login = $_POST['login'];
- $password = $_POST['password'];
- mysql_connect('localhost','root','root');
- echo "2";
- mysql_select_db('hack');
- echo "3";
- $login = $_POST['login'];
- $password = $_POST['password'];
- $re = mysql_query("select * from users where login = '$login' and password = '$password'");
- echo "re :";
- echo $re;
- if(mysql_num_rows($re) != 0){
- $temps = 365*24*3600;
- setcookie ("credentials", $login.":".$password, time() + $temps);
- header('Location: ./home.php');
- } else {
- $_SESSION['error'] = true;
- header('Location: ./login.php');
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement