jeudi 14 mai 2015

PHP including wrong file?

I am trying to make it so that the nav1.php file is included by default and when the user logs in it includes nav2.php instead. But for some reason it is displaying it is displaying nav2.php by default. Can someone please help? Thanks in advance!

index.php

<?php 

if ($email != $dbEmail && $password != $dbPassword) {
    include 'includes/nav1.php';
}

if ($email == $dbEmail && $password == $dbPassword) {
    include 'includes/nav2.php';
}

?>

Login.php

    if ($email == $dbEmail && $password == $dbPassword){
        $_SESSION['email'] = $email;
        $_SESSION['id'] = $userId;
        header('Location: index.php');

    } else {
        echo "Incorrect Email Or Password";
    }

Aucun commentaire:

Enregistrer un commentaire