<?php
session_start();
if(!isset($_SESSION['un']))
{
header('Location: web_login.html');
exit();
} 
else 
{
?>
<html>
<body>
<?php
        print "<table align='center'><tr><td>Thank u</td></tr>";

        echo $_SESSION['un'];

        print "<tr><td><a href='http://www.examples.com/fram.php'>View  Order</a></td></tr>";

        print "<tr><ta><a href='http://www.examples.com/web_job.php'>Search </a></td></tr>";

        print "</table>";
}
?>
</body>
</html>

when i execute this code even though my $_SESSION is present in the database it's showing the web_login page.else is not working.any error in header include code.

Use if(!session_is_registered('un')) instead of if(!isset($_SESSION))

May be it will work,,

Jino.

Add whatever value to $_SESSION and then check again. I guess it has to have username ? When the user logs in, assign the username to $_SESSION.

This question has already been answered. Start a new discussion instead.