Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('display_errors', 1); error_reporting(~0);
- if (isset($_POST['email']))
- {
- if(isset($_POST['password'])){
- }
- require_once 'connect.php';
- $email = $mysqli->escape_string($_POST['email']);
- $password = $mysqli->escape_string($_POST['password']);
- $result = $mysqli->query("SELECT * FROM users WHERE email='$email'");
- if ($result->num_rows == 0){
- header("location: error_page.php");
- }
- else {
- $user = $result->fetch_assoc();
- if (password_verify($password, $user['password'])){
- $_SESSION['id'] = $login['id'];
- $_SESSION['email'] = $loging['email'];
- header("location: welcome.php");
- }
- }
- }else{
- header("location: error_page.php");
- exit();
- }
- ?>
Add Comment
Please, Sign In to add comment