Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'conn.php';
- $con = @new mysqli($host,$db_login,$db_pass,$db_name);
- if($con->connect_errno!=0)
- {
- echo "Can't connect to database: ".$con->connect_errno." Desc: ".$con->connect_error;
- }
- else
- {
- $username = htmlentities($_POST['login']);
- $password = htmlentities($_POST['password']);
- $res = mysqli_query($con,"SELECT * FROM users WHERE '$username'=login AND '$password'=pass");
- if(mysqli_num_rows($res)==0)
- {
- header('Location: index.php');
- }
- else
- {
- echo Zalogowano!
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement