The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 20, 2019, 11:08:43 AM

Login with username, password and session length


Pages: [1] 2 3
  Print  
Author Topic: Referrer has gone to hell in a hand basket..  (Read 6933 times)
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« on: July 23, 2010, 09:55:06 AM »

Is there something new going on with the referrer now, I have never had a problem before but the ip and ua is coming thru just fine but no ref or uri? Talk about strange.. so I placed it on another site and same result.. The original problem was discovered when I was using a site referrer to allow folks to enter my site without pass/user.
In other words if they were on a site and logged in  then a button they clicked allowed them to enter another site simply by my checking their Referrer... one day they could not get in... I looked and found the referrer arrriving blank.
I complained to that site and they said they had done nothing to suppress the referrer... WOW!
Below is the code that was perfect before and now only gives the ip and ua and blank ref and blank uri.. weird to say the least..

$ip = $_SERVER['REMOTE_ADDR'];
$ref = $_SERVER['HTTP_REFERRER'];
$ua = $_SERVER['HTTP_USER_AGENT'];
$uri = $_SERVER["REQUEST_URI"];

$kp = explode("/", $ref);
$y = count($kp)-1;
$uri = $kp[$y];


echo "IP = $ip
";
echo "REFERRER = $ref
";
echo "UserAgent = $ua
";
echo "URI = $uri
";

So to troulbeshoot, I placed a link on another site belonging to me unrelated to that original referring site... same results... no referrer and not uri....
also i added something like ?visit=fromvahud etc and the visit varialbe came thru just fine.. but nothing still showed on the uri...
Folks I have used this exact code a million times before... has anything changed in PHP to stop it?

Thanks for any suggestions....its killing me...
Logged
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #1 on: July 23, 2010, 10:22:41 AM »

$ref = $_SERVER['HTTP_REFERRER'];

Just noticed the RR above... that was a last resort attempt, it won't work with a single R either..
I just forgot to change it back before I posted.. sorry...
Logged
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #2 on: July 24, 2010, 12:17:27 AM »

What I would do to troubleshoot this is use firefox's LiveHeaders or wireshark packet sniffer
in order to verify what *I* am sending to the server.  (the RefControl plugin allows me to
set any referer that I choose) I mean, that's the beginning of the chain of events, so that's
what needs to be confirmed first, imo.

The next step might be to put phpinfo.php on my site and see what that tells me.  I'm not
a php guy so not sure if that would show URI or referer.

Third, I would check with different code that is plain, simple and does nothing else.

Another thing is that $_SERVER['HTTP_REFERER'] is one element in an array, so you could print out the entire array to see what's there.

Bompa
« Last Edit: July 24, 2010, 12:19:30 AM by Bompa » Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #3 on: July 24, 2010, 08:27:13 AM »

Zactly Bomps ...print_r($_SERVER) for starters. Is this a new hosting arrangement? Could be a slightly different set up web server? print_r($GLOBALS) might shed some light as well. Just a stupid side question, you are actually coming from another page, not just entering the URL, right?   
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #4 on: July 24, 2010, 08:04:38 PM »

Here is the output of both of the methods you suggested... the IP and urls have been modified to protect the guilty.
But problem is i have never seen anything like this.. there is absolutely no reference to any other domain except the landing domain... I have used this code forever and a million times and it always showed the Referrer domain.. as a matter of fact i used it for years to allow entry to the site as long as they came from this referred domain...
This is just not right.... so just to make sure the sending site was not suppressing the referrer I asked and they said no they had not done anything....
So just to be sure I set up a link to my site on one of my other sites and sure enought no referrer was sent and I have done this a zillion times in the past..

The below Remote Address = my IP that i am running.. changed to protect my true identity.
The below Server Address = the actual IP of my server, and not the sending server....
And I can find no other IP or domain name suggesting a referral from lets say.. leads.longnecktownroi.com which is where the referral is coming from... sllghtly modified..

I do see a Request URI which helps, but I really need the referrer domain so i can let folks into my site based on where they came from and have done it for years... and that is why I am so confused.... what am I missing?


Totally wild....

Code:
ServerArray
(
    [DOCUMENT_ROOT] => /home6/myoldeream0/public_html
    [GATEWAY_INTERFACE] => CGI/1.1
    [HTTP_ACCEPT] => */*
    [HTTP_ACCEPT_ENCODING] => gzip, deflate
    [HTTP_ACCEPT_LANGUAGE] => en-us
    [HTTP_CONNECTION] => Keep-Alive
    [HTTP_HOST] => myoldrealestatesuperstore.com
    [HTTP_UA_CPU] => x86
    [HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6.5; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
    [HTTP________] => ----:-----------------------------------------------------
    [PATH] => /bin:/usr/bin
    [QUERY_STRING] =>
    [REDIRECT_STATUS] => 200
    [REMOTE_ADDR] => 74.115.233.12
    [REMOTE_PORT] => 3124
    [REQUEST_METHOD] => GET
    [REQUEST_URI] => /intranet/admin.php
    [SCRIPT_FILENAME] => /home6/myoldream0/public_html/intranet/admin.php
    [SCRIPT_NAME] => /intranet/admin.php
    [SERVER_ADDR] => 21.120.240.157
    [SERVER_ADMIN] => webmaster@myoldrealestatesuperstore.com
    [SERVER_NAME] => myoldrealestatesuperstore.com
    [SERVER_PORT] => 80
    [SERVER_PROTOCOL] => HTTP/1.1
    [SERVER_SIGNATURE] => Apache/2.2.15 (CentOS) mod_ssl/2.2.15 0.9.8l DAV/2 mod_auth_passthrough/2.1 FrontPage/5.0.2.2635 Server at myoldrealestatesuperstore.com Port 80

    [SERVER_SOFTWARE] => Apache/2.2.15 (CentOS) mod_ssl/2.2.15 0.9.8l DAV/2 mod_auth_passthrough/2.1 FrontPage/5.0.2.2635
    [UNIQUE_ID] => TEukr0KT8J0AAFF@3u0AAAIG
    [file_gzip] => /ramdisk/cpud/status
    [PHP_SELF] => /intranet/admin.php
    [REQUEST_TIME] => 1280025775
    [argv] => Array
        (
        )

    [argc] => 0
)
GlobalsArray
(
    [GLOBALS] => Array
 *RECURSION*
    [_POST] => Array
        (
        )

    [_GET] => Array
        (
        )

    [_COOKIE] => Array
        (
        )

    [_FILES] => Array
        (
        )

    [_SERVER] => Array
        (
            [DOCUMENT_ROOT] => /home6/myoldream0/public_html
            [GATEWAY_INTERFACE] => CGI/1.1
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, deflate
            [HTTP_ACCEPT_LANGUAGE] => en-us
            [HTTP_CONNECTION] => Keep-Alive
            [HTTP_HOST] => myoldrealestatesuperstore.com
            [HTTP_UA_CPU] => x86
            [HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6.5; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
            [HTTP________] => ----:-----------------------------------------------------
            [PATH] => /bin:/usr/bin
            [QUERY_STRING] =>
            [REDIRECT_STATUS] => 200
            [REMOTE_ADDR] => 74.115.233.12
            [REMOTE_PORT] => 3124
            [REQUEST_METHOD] => GET
            [REQUEST_URI] => /intranet/admin.php
            [SCRIPT_FILENAME] => /home6/myoldream0/public_html/intranet/admin.php
            [SCRIPT_NAME] => /intranet/admin.php
            [SERVER_ADDR] => 21.120.240.157
            [SERVER_ADMIN] => webmaster@myoldrealestatesuperstore.com
            [SERVER_NAME] => myoldrealestatesuperstore.com
            [SERVER_PORT] => 80
            [SERVER_PROTOCOL] => HTTP/1.1
            [SERVER_SIGNATURE] => Apache/2.2.15 (CentOS) mod_ssl/2.2.15 0.9.8l DAV/2 mod_auth_passthrough/2.1 FrontPage/5.0.2.2635 Server at myoldrealestatesuperstore.com Port 80

            [SERVER_SOFTWARE] => Apache/2.2.15 (CentOS) mod_ssl/2.2.15 0.9.8l DAV/2 mod_auth_passthrough/2.1 FrontPage/5.0.2.2635
            [UNIQUE_ID] => TEukr0KT8J0AAFF@3u0AAAIG
            [file_gzip] => /ramdisk/cpud/status
            [PHP_SELF] => /intranet/admin.php
            [REQUEST_TIME] => 1280025775
            [argv] => Array
                (
                )

            [argc] => 0
        )

)
Logged
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #5 on: July 24, 2010, 08:07:14 PM »

Its late and i am tired..but tomorrow I will analyze the Awstats data to see if the referrer is showing up there... won't really help with this project, but at least I will know I am not crazy... or maybe I won't know...
Logged
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #6 on: July 24, 2010, 08:12:03 PM »

$_SERVER['HTTP_REFERRER'];


Hell I just noticed there is not referer variable even listed there blank or otherwise...
No freaking wonder it won't work... Is it possible for PHP to have removed that.. surely the server owner could not have removed just the one variable.... any ideas...
Logged
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #7 on: July 24, 2010, 08:30:17 PM »

Things are getting worse folks, as I thought  I was onto something... so I did the following:
Ran a print phpinfo() on the faulty site and found no server referer variable...
But then I ran the same phpinfo() on a totally unrelated server on a different host... hostgator and found the same missing variable... the server referer variable was not listed in the phpinfo() of either server output..

I am totally lost now... can someone pls check the phpinfo() on their server and just see if the variable shows up..
Folks these two servers are in no way related..... yet the php in both are missing this variable.
Logged
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #8 on: July 25, 2010, 04:34:08 AM »

I am totally lost now... can someone pls check the phpinfo() on their server and just see if the variable shows up..
Folks these two servers are in no way related..... yet the php in both are missing this variable.

Stay calm.

I guess phpinfo.php does not show that variable.

I was wrong to suggest that.

Bompa
Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
Bompa
Administrator
Lifer
*****
Offline Offline

Posts: 564


Where does this show?


View Profile
« Reply #9 on: July 25, 2010, 04:36:28 AM »

Btw, do you have an anti virus sotware running?

New OS?
« Last Edit: July 25, 2010, 04:39:23 AM by Bompa » Logged

"The most beautiful and profound emotion we can experience is the sensation of the mystical..." - Albert Einstein
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #10 on: July 25, 2010, 08:41:42 AM »

antivirus?Huh? what's that? hee....hee... just kidding.... yes.. I do but my OS has nothing to do with the problem as this little piece of software is used to direct all the incoming visitors arriving at the site... so not only will an existing system that diverted normal for years will no longer divert my OS or any other visitor arriving at the site..
Problem is it worked forever in hundreds of sites and now the referrer has disappeared..

Makes sense to me that phpinfo() should show that variable as it does every other single server variable..
That is why I asked if someone could see if it shows on their use of phpinfo().

I have been programming PHP and tons of other languages for years... but cannot figure this one out..

I will play with using javascript to grab the referrer later today to see if that will shed any light on the subject.
Its just gotta be thre unless its being blanked or suppressed by the sender but i am sure it is not being suppressed.



Logged
DangerMouse
Expert
****
Offline Offline

Posts: 244



View Profile
« Reply #11 on: July 25, 2010, 10:57:28 AM »

Are they incoming from a HTTPS connection? Are you testing Referrer from random URLs or just the URL with the problem?

DM
Logged
ehlo
Journeyman
***
Offline Offline

Posts: 50


View Profile
« Reply #12 on: July 25, 2010, 12:56:36 PM »

Just to check, are you running php on cgi? It's just that it doesn't always have all the server variables set so that might be why.

You could try: getenv("HTTP_REFERER");
Logged
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #13 on: July 25, 2010, 06:22:57 PM »

No https is being used...  its plain old vanilla http
I am not running Cgi..
I have pointed two other sites to this link.. one from hostgator and one from my very own VPS.
Nothing has been changed on my server and the php has not been reloaded and tampered with.


Does anyone know if this variable should have been included in the php variables shown above..
I am assuming it should be there otherwise how would I be able to read this variable...
$_SERVER['HTTP_REFERER'];
However it did not show in my phpinfo() on either site that I ran it... the hostgator and VPS site.

Again I keep coming back to the fact that i have used this code on a ton of sites for years.....
Now it does not seem to work on at least two of them...

If someone would drop this variable on a normal php site it would be very helpful...

<?
$ref = $_SERVER['HTTP_REFERER'];
print "REF = $ref
";
?>

That is all just 3 lines... but of course you must put a link on another site like...
Test Referrer
Pointing to the site with the referer printer above.. it should simply print "www.mydomain.com" on your screen...
It always did before.

Logged
tommytx
Expert
****
Offline Offline

Posts: 123


View Profile WWW
« Reply #14 on: July 25, 2010, 06:29:25 PM »

If anyone wants to help I just set up a test at the actual site... click the link and it should show perkiset.org as the referer...
Click me to test the referer
Logged
Pages: [1] 2 3
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!