Solved

Show Splah DIV only once per session

Posted on 2009-05-05
1
868 Views
Last Modified: 2012-05-06
Could someone show me a simple example of how to show a splash div only once per session? I am using php, but the example could be any server side code.

Thanks. I am pulling my hair out on this one!
0
Comment
Question by:edvinson
1 Comment
 
LVL 39

Accepted Solution

by:
Roger Baklund earned 500 total points
ID: 24305106
Try this:
<?php
session_start();
?>
<html><head>
# html head code here
</head>
<body>
# more code here
<?php
if(!isset($_SESSION['splash_was_displayed'])) {
  $_SESSION['splash_was_displayed'] = true;
?><div class="splash">
(Splash content)
</div>
<?php } ?>

Open in new window

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question