Jump to content

[SOLVED] Session varible


joecooper

Recommended Posts

on a logon page, once the user has put in all their login details, and its been verified etc, i use this code:

 

$_SESSION['loggedin']="TRUE";

 

then the user clicks a link to another page with this code:

 

 

<?php
include("db.php");

if($_SESSION['loggedin']=="TRUE"){
   echo("Welcome $username!<br>");
   echo("<hr>");
}else{
   die("You are not logged in. Please <a href='login.php'>click here</a> to log in!");
}
?>

 

and it just says they are not logged in

Link to comment
https://forums.phpfreaks.com/topic/104150-solved-session-varible/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.