Display a part of page only once

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Display a part of page only once

Post by pilau »

I need to display a part of my page only the first time a user displays the first page.
The site is not using sessions or any loging systems.

I thought of creating a cookie the first time the user displays the first page, that would last for an hour. The PHP page would check for that cookie's existance anf it's there - wouldn't display that part.

Is there a better and/or safer and/or faster and/or not based on time (e.g. 1 hour cookie) way to make this?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Cookies seem to be the only half-reliable way ti remember people. Lots of people turn cookies off though :\
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post by pilau »

Well then they would have to suffer the wrath of the
"part-that-should-have-been-displayed-only-once-but-will-be-displayed-every-time-the-first-page-loads"! :twisted:
Post Reply