CONDOI
asked on
Do if with the session.
if "$user" = "$user"
{
echo "<p>still in the secure area.</p>";
include ("secure.php");
exit;
}
else
echo "sign out already";
{
echo "<p>still in the secure area.</p>";
include ("secure.php");
exit;
}
else
echo "sign out already";
in order to be able to check your session vars you must call session_start() function in every page prior to start checking session vars existence. you can put the call in your header to be absolved of this worry, since you must include the header on every page of the site. the approach presented in the post above is ok, i am using a similar one too.
pls check out my post on this thread
https://www.experts-exchange.com/questions/21332607/login-script.html
kind regards,
mircea
pls check out my post on this thread
https://www.experts-exchange.com/questions/21332607/login-script.html
kind regards,
mircea
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
Split between 4Rabbits, msimion and ldbkutty
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
- Neester -
EE Cleanup Volunteer
I will leave the following recommendation for this question in the Cleanup topic area:
Split between 4Rabbits, msimion and ldbkutty
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
- Neester -
EE Cleanup Volunteer
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:
Accept 4Rabbits solution
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
- Neester -
EE Cleanup Volunteer
I will leave the following recommendation for this question in the Cleanup topic area:
Accept 4Rabbits solution
Any objections should be posted here in the next 4 days. After that time, the question will be closed.
- Neester -
EE Cleanup Volunteer
<?php
session_start();
if ( isset( $_SESSION["user"] ) && !empty( $_SESSION["user"] ) )
{
echo "<p>still in the secure area.</p>";
include ( "secure.php" );
exit();
}
else
echo "sign out already";
?>