Created
March 13, 2012 13:37
-
-
Save fajran/2028817 to your computer and use it in GitHub Desktop.
Referer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<pre> | |
File: <?=basename($_SERVER['SCRIPT_FILENAME']);?> | |
Referer: <?=$_SERVER['HTTP_REFERER'];?> | |
Lanjut: <a href="index.php">index.php</a> | |
<a href="a.php">a.php</a> | |
<a href="b.php">b.php</a> | |
<a href="c.php">c.php</a> | |
Loncat: <a href="loncat-ke-index.php">loncat-ke-index.php</a> | |
<a href="loncat-ke-a.php">loncat-ke-a.php</a> | |
<a href="loncat-ke-b.php">loncat-ke-b.php</a> | |
<a href="loncat-ke-c.php">loncat-ke-c.php</a> | |
Source: <a href="<?=basename($_SERVER['SCRIPT_FILENAME']);?>s"><?=basename($_SERVER['SCRIPT_FILENAME']);?>s</a> | |
<a href="loncat-ke-<?=basename($_SERVER['SCRIPT_FILENAME']);?>s">loncat-ke-<?=basename($_SERVER['SCRIPT_FILENAME']);?>s</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$fname = basename($_SERVER['SCRIPT_FILENAME']); | |
preg_match('/^loncat-ke-(\w+)\.php$/', $fname, $m); | |
if (isset($m[1])) { | |
$next = $m[1]; | |
header('location: ' . $next . '.php'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment