Hi there
I need to be able to clear all the session variables when the link to my main_menu.php is used - the first thing main_menu needs to do is dump whatever the session variables have.
I have tried using unset and session_destroy but I'm not getting anywhere.
I've read a bunch of posts from this forum and nothing has helped yet.
Session_destroy isn't working because main_menu is also the entry point into the software and if it's the first time into the software the following message appears:
Warning: session_destroy() [function.session-destroy]: Trying to destroy uninitialized session in /var/www/localhost/htdocs/costing/firstpage.php on line 4.
The code for main_menu is:
PHP Code:<?PHP
unset ($_SESSION['region']);
unset ($_SESSION['region2']);
session_start();
$status_level=$_SESSION['status_level'];
$_SESSION['status_level']=$status_level;
?>
<html>
<title>Schedule of Costing (new selection)</title>
<head>
<link rel="stylesheet" type="text/css" href="costingstyle.css" />
</head>
<body>
<br>
<br>
<p><HEADS>      Please select a region</HEADS>
<br>
<br>
<?
if ($status_level == 1) {
?>
<form action=admin_selection.php method=post>
            <select name="region">
<option value="Gauteng">Gauteng</option>
<option value="Cape">Cape</option>
<option value="KZN">Natal</option>
</select>
<br>
<br>
<br>
            <input type=submit value="Submit">
</form>
<?
}
else {
?>
<form action=selection.php method=post>
            <select name="region">
<option value="Gauteng">Gauteng</option>
<option value="Cape">Cape</option>
<option value="KZN">Natal</option>
</select>
<br>
<br>
<br>
            <input type=submit value="Submit">
</form>
<?
}
?>
<br>
<br>
<br>
<LINKS><a href=logout.php><font size=2>Logout</a></LINKS>
</body>
</html>
I would appreciate any advice!







Bookmarks