Solved

Show Splah DIV only once per session

Posted on 2009-05-05
1
871 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

830 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