php - How to redirect if not from $_SERVER['HTTP_REFERER']? -


<?php if (ereg("www\.test", $_server['http_referer']) != true) {     header("location http://www.example.com");     end; }     echo "111";         //dosomting? ?> 

it still not working

try this:

<?php     if (!preg_match("www\.test", $_server['http_referer'])) {       header("location: http://www.example.com");       exit();    }    //do stuff...  ?> 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

c++ - How to modify context menu of internet explorer using IDocHostUIHandler::ShowContextMenu? -

c# - Asterisk click to call -