| Comments |
| Til posted on December 8, 2006, 11:31 am |
| Hi! First, thanks a lot for this code! Now I have tried this code in my index.php on my homepage (in a subdirectory) and it works well with Firefox or Opera, but not with Internet Explorer! Using the Internet Explorer the user is always redirected, even when he comes (is referred) from mydomain.com. Any idea how to correct this? Thanks in advance! Mrs.Bungle. here's my index.php: <? $referrer = $_SERVER['HTTP_REFERER']; if (preg_match("/mydomain.com/",$referrer)) { include("iindex.htm"); } else { header('Location: http://mydomain.com'); }; ?> ----------------- PHPjabbers: try using apache_request_headers() instead (formerly getallheaders). <?php $host=apache_request_headers(); if(!eregi('domain.com',$host[Referer])){ // TRUE }else{ // FALSE } ?> |
| bhaskar verma posted on August 18, 2006, 2:33 am |
| hello, ur logic of referer has helped me a lot. Thnx .. |