Jump to content

PHP and JavaScript Referrers


bubba1356

Recommended Posts

Hey guys,

 

I'm building a web stats package in php. I've managed to use javascript to call a php file which sniffs out the browser data and stores it in a MySQL table. The calling script is as follows:

 

<script type="text/javascript" src="addview.php"></script>

 

This is all good, the php file called by this script takes the calling page URL using the referrer header:

 

$Page = getenv('HTTP_REFERER'); 

 

Only problem is this: since the referral header changes once the php page loads, I cant find the referral to the page I need (i.e. the referral header BEFORE the php page loads). I was gonna get round this by storing the referrer using javascript in a variable and pass this to the php file???

 

Anyone have any ideas?

 

Cheers,

 

Bubba

Link to comment
https://forums.phpfreaks.com/topic/99721-php-and-javascript-referrers/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.