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? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -