Jump to content

[SOLVED] isset or no isset


zGrassman

Recommended Posts

session_start();
if($_SESSION[loggedin]) {

include('sidebar.php');
include('connect.php');
}

else{
print "bla";
}

 

Or should i use

 


session_start();
if(isset($_SESSION[loggedin])) {

include('sidebar.php');
include('connect.php');
}

else{
print "bla";
}

 

or does it really matter

Link to comment
https://forums.phpfreaks.com/topic/72741-solved-isset-or-no-isset/
Share on other sites

If you are trying to check if $_SESSION[loggedin] is set to a value use

 

session_start();

if(isset($_SESSION[loggedin])) {

 

include('sidebar.php');

include('connect.php');

}

 

else{

print "bla";

}

 

if not use the other one. Really based on what you are doing.

yea, im checking to see if the value is == to 1. im new at this stuff, so i guess i want to check if a user is signed in sorta speak. if they are then it shows stuff, if it isnt it shows something else. i changed the source to isset and it works fine. both work fine, i was just curious. so i guess it doesnt matter?

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.