Jame Steadman
New member
Hi, i know HTML and CSS and am currently learning PHP i am making a website for experiance and am using php tutorials and stuff to help me understand it, but i have a problem how do i tell if the user is logged in? i want it so if the user is logged in it displays there stats and stuff but if there not logged in it displays the login form. i have been using this
<?php
if (isset($_SESSION["name"]))
{ echo "Welcome " . $_SESSION["username"] . "!<br />"; }
else
{ echo ('you are not logged in');
}
?>
but it doesnt work even when i log in it echo's you are not logged in even when i am.
please could someone help me on here or msn or yahoo messenger witch one of them would be easier.
my msn is [email protected]
and my yahoo messenger is [email protected]
Thank you for you help in advance
yes i have session_start(); at the begining.
And what do you mean what veriables do i have when the user logs in ?
sorry i am not to sure what you mean.
Thanks Jamie
<?php
if (isset($_SESSION["name"]))
{ echo "Welcome " . $_SESSION["username"] . "!<br />"; }
else
{ echo ('you are not logged in');
}
?>
but it doesnt work even when i log in it echo's you are not logged in even when i am.
please could someone help me on here or msn or yahoo messenger witch one of them would be easier.
my msn is [email protected]
and my yahoo messenger is [email protected]
Thank you for you help in advance
yes i have session_start(); at the begining.
And what do you mean what veriables do i have when the user logs in ?
sorry i am not to sure what you mean.
Thanks Jamie