Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jswolf

    (@jacobshaw)

    Is there any way to help me figure out why no session populates in the table in mysql?

    Thread Starter jswolf

    (@jacobshaw)

    Yes, I did activate it.
    This is the login page. attempting to place inputs from a form into the respective sessionn variables

    <?php
    session_start();
    
    if (isset($_POST["Submit"]) ) {
    	$user = $_POST["user"];
    	$pass = $_POST["pass"];
    	if (authenticate($user, $pass) ) {
    		$_SESSION['user']=$user;
                    $_SESSION['pass']=$pass;
                    echo("<h2>Login Successful</h2>");
    	}
    	else
    	{
    		loginform();
    	}
    }
    else
    {
    	loginform();
    }

    Then, I go to the following page, I test to see if they are empty and create new variables if they are set

    <?php
    session_start();
    if (isset($_SESSION['user'])) {
    $user=$_SESSION['user'];
    $pass=$_SESSION['pass'];
    }
    else
    {
    echo("<h1>No credentials found</h1>");
    exit();
    }
    • This reply was modified 3 years, 11 months ago by jswolf.
    • This reply was modified 3 years, 11 months ago by jswolf.
    • This reply was modified 3 years, 11 months ago by jswolf.
    • This reply was modified 3 years, 11 months ago by jswolf.
Viewing 2 replies - 1 through 2 (of 2 total)