Tell if refreshing?

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
cbrian
Forum Commoner
Posts: 97
Joined: Sun Feb 27, 2005 12:29 pm

Tell if refreshing?

Post by cbrian »

Is there a way to tell if someone refreshed the current page?
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Code: Select all

//untested
session_start();

if(!isset($_SESSION['pg_cnt'])){

$_SESSION['some_page_id'] = TRUE;

}else{ 

 echo 'Page Hit';

}
/*on any other page you would have to make $_SESSION['some_page_id'] = false
*/
cbrian
Forum Commoner
Posts: 97
Joined: Sun Feb 27, 2005 12:29 pm

Post by cbrian »

Well, this is a game, where you're really on the same page the whole time, in a battle...so I don't think that would really work.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

Why not?
Post Reply