Hi Rahia.
Try the following:
-
if (strpos($_SERVER['HTTP_REFERER'], 'xyz.php'))
-
{
-
header('Location:'.$_SERVER['HTTP_REFERER']);
-
}
-
Here, we are searching the PHP variable ($_SERVER['HTTP_REFERER']) for an occurance of the string (xyx.php).
If this is true, then the page is directed to itself (i.e. reloaded) on this occassion ($_SERVER['HTTP_REFERER']).
If you want to redirect to another page, simply change:
header($_SERVER['HTTP_REFERER'])
-to-
header('Location:' XXX);
where XXX is the appropiate URL.
I hope this helps.