Page 1 of 1

detecting refresh browser activity in PHP

Posted: Wed Oct 29, 2003 12:49 pm
by nirma78
Hi

I am working on a web application using PHP and Oracle.

I would like to know is there any way we can detect if the back browser button is clicked or the refresh browser button is clicked ???


Any help on this is appreciated.
Thanks in advance

Posted: Wed Oct 29, 2003 12:59 pm
by qads

Code: Select all

<?php
if(!isset($_SESSION['bla']))
{
$_SESSION['bla'] = 1;
}
else
{
$_SESSION['bla']++;
}
?>
i would use sessions, for example, when the page is loaded the first time $_SESSION['bla'] is set to 1, if the user reloads the page then it would add 1 to its value, after that you can use soemthing like

Code: Select all

<?php
if($_SESSION['bla'] != 1))
{
//your code here
}

?>
you can do the same with cookies by the way :wink:.

Posted: Wed Oct 29, 2003 1:19 pm
by nirma78
Thanks will try it out !!