0

Trying to create a simple PHP login page, do not need to access database. It will just bring them to another page, where they will have other options to add, delete etc. I am calling a HTML file, and it enters the code below, but it stops at part 1...

is it because of superglobals? or else how should i go about with this?

thanks!!!

<?php
    session_start();
    
    $username = "user";
    $password = "password";
    
    echo 'Part 1';
    
    if(isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true)
    {
        echo 'Part 2';
        header("Location: successLogin.php");
    }
    
    if(isset($_POST['username']) && isset($_POST['password']))
    {
        if($_POST['username'] == $username && $_POST['password'] == $password)
        {
            $_SESSION['loggedin'] = true;
            echo 'Part 3';
            header("Location: successLogin.php");
        }
    }
?>

0 Answers0