natalieG Posted April 8, 2006 Share Posted April 8, 2006 in the file index-2, we want to have a differenf banner[headerswish.html] the firsttime the application is opened and after that we want the banner[statichead.html] to show.we do start the application on the first line of the file withsession_start();[MORE CODE][b]<tr><td> <?php if (isset($_SESSION['START'])) {include 'statichead.html';} else {include 'headerswish.html';} ?></td></tr>[/b][MORE CODE TO LAST LINE]$_SESSION['START']=1;What happens is that even on the first execution, before $_SESSION['START'] is set,the banner headersawish is shown. So, it acts liuke the session variable is always set.Thanks,Jennifer Quote Link to comment Share on other sites More sharing options...
toplay Posted April 8, 2006 Share Posted April 8, 2006 First delete any session cookies and/or exit the browser before each test (I'm assuming that you're using default php.ini settings).The first time it should include headerswish, and there after statichead (until session expires).What you stated is what is supposed to happen: "...on the first execution, before $_SESSION['START'] is set, the banner headersawish is shown."If after the first time it keeps showing headerswith, then it means your sessions are NOT being saved. See my session troubleshooting post in the FAQ page pinned at the top of the newbie topic area for help. Quote Link to comment Share on other sites More sharing options...
natalieG Posted April 8, 2006 Author Share Posted April 8, 2006 Yor are correct!. Thanks very muchJen Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.