Location: PHPKode > scripts > Link Obfuscator > link-obfuscator/test.php

 *@author Cerion Morgauin
 * @version $Id$
 * @copyright Enrico Marongiu (cerion hide@address.com tiscali _._ it) - 2004
*  linkObfuscator manages a simple way of validating links: starting from a session, an user can browse exclusively those links that are performed by this page. to do this, a random seed is generated and a special code (named go) is attached to each link.
* each page that has to be obfuscated needs this class and a $linkObfuscator::check() to validate the user.



$lO=new linkObfuscator($_SESSION['referralSeed']);
print "actual referral Seed:". $_SESSION['referralSeed'] ."<br />\n";
if ($lO->referralSeed) {
		print "checked link: ${_SERVER['REQUEST_URI']}<br />\n";
		print "link invalid: ${_SERVER['REQUEST_URI']} \n";

$newLink= preg_replace('/(&|\?)go=(\w)+/','',$_SERVER['REQUEST_URI']);

<a href="<?=$newLinkObscured?>">Obscured</a>
Return current item: Link Obfuscator