开发者

Show different content after page refresh

A .php page checks if the referer is from xdomainname.co开发者_StackOverflow社区m, if Yes i iframe page X if not i iframe page Y.

The problem is i want to redirect to another page if the .php page is refreshed (iframe page X/Y on first load only).

I tried adding Cache headers but the .php page is still iframing page X/Y -depending on referer.

header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
header( 'Cache-Control: post-check=0, pre-check=0', false );
header( 'Pragma: no-cache' );

Other than cookies, is there any workarround to clear referer post data or detect a first page load (maybe creating a hidden field and detecting its value on a second page load)?


if (!isset($_SESSION['pageload'])) {
$_SESSION['pageload'] = "true";
header("Location:somepage.php");
} else {
unset($_SESSION['pageload']);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜