Guest kilbad Posted September 3, 2006 Share Posted September 3, 2006 I am having the following problem.. the first example of code works if it is in a subdir of my website. However, the same script (minus the reference to the subdir) does not work when in my root web dir.. any ideas?Example 1 works; located in the test dir, if loaded from a previous page in the test dir, it both echos the referer and "passed validation"::[code]<?phpecho $_SERVER['HTTP_REFERER'];if ( eregi ( "http://example.com/test", $_SERVER['HTTP_REFERER'] ) ){ echo "passed validation";}else{ echo "Nice try";}?>[/code]Example 2 doesnt work; located in my root web dir, if loaded from another page in the root dir, never echos the referer or "passed validation"::[code]<?phpecho $_SERVER['HTTP_REFERER'];if ( eregi ( "http://example.com/", $_SERVER['HTTP_REFERER'] ) ){ echo "passed validation";}else{ echo "Nice try";}?>[/code] Quote Link to comment Share on other sites More sharing options...
effigy Posted September 3, 2006 Share Posted September 3, 2006 What is in[tt] $_SERVER['HTTP_REFERER'][/tt]? Keep in mind that[tt] . [/tt] is a metacharacter in regex. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.