I have this code for referer redirect: <? $referrer = $_SERVER['HTTP_REFERER']; if (preg_match("/outsidesite.com/",$referrer)) { header('Location: http://www.mysite1.com'); } else { header('Location: http://www.mysite.com'); }; ?> But the question is: If I want to match a LIST OF SITES stored on a txt file, insted of "outsidesite.com". How can I work with a txt list of sites: "mysites.txt" instead of only one site: "outsidesite.com" <? $referrer = $_SERVER['HTTP_REFERER']; if (preg_match("HERE A TXT WITH A LIST OF SITES mysites.txt",$referrer)) { header('Location: http://www.mysite1.com'); } else { header('Location: ht*tp://www.mysite.com'); }; ?> Anyone knows what to put here: ("HERE A TXT WITH A LIST OF SITES mysites.txt"), to make it functional. Thanks.
I am working with this: $file=file_get_contents("file.txt"); if (preg_match ("/$file/", ........... But it only retrives the first value in the txt file, not the second line. How can I retrive all values, and then call $file? thank you.