Quote:
Originally Posted by FakeNick
like this you mean
PHP Code:
<?
// Redirect "password" traffic
$refer_full_path = "$HTTP_REFERER"."$PATH_INFO";
if(( preg_match("/pass/i", $refer_full_path)) ||
( preg_match("/passes/i", $refer_full_path)) ||
( preg_match("/password/i", $refer_full_path)) ||
( preg_match("/passwords/i", $refer_full_path))) {_
header("Location: $refer_full_path");
exit;_
}
?>
PHP Code:
<?
$words=array("pass","passes","password","passwords");
for($i=0;$i<count($words);$i++){
if(eregi($words[$i],$HTTP_REFERER)){
header("Location: http://www.adultfriendfinder.com");
}
}
?>
|
Oh god...
1) REGISTER GLOBALS?!?!?! You insane?
2) Performance wise eregi or preg_match are extremely bad for this kind of stuff, use strpos for it, also checking for "pass" will match "passes" and "password" and "passwords" so why even check for "passes", "password", "passwords" after that?! No point.
3) In your 2nd example, add an exit after the header(); so it stops searching on a match...