Jump to content

Problems with EREGI and $_SERVER in my root web dir


Guest kilbad

Recommended Posts

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]<?php
echo $_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]
<?php
echo $_SERVER['HTTP_REFERER'];

if ( eregi ( "http://example.com/", $_SERVER['HTTP_REFERER'] ) )
{
   
    echo "passed validation";
}
else
{
    echo "Nice try";
}

?>[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.