Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache - SERVER LOG - Urgent

Status
Not open for further replies.

SuperT

Programmer
Feb 5, 2001
8
0
0
IE
I dont use this on every page on my site, but this might be of some use to you ...

On certain PHP scripts I keep track of variable values (what people are searching for) by logging that data into a MySQL table (but you could just log it to a file). The static variable $HTTP_REFERER of a call to product.php would look simmular to this
"/product.php? pid=96 & userid=56"

A simple PHP script could setup the information in the format you want, and log that information into any file or database. That PHP script could then be added to the beginning of any PHP script you want to track by means of an "include".

I use the list & and explode functions to break my variable up for storage into a database. That database information is then used with other PHP scripts to create realtime graphs of what users are looking for on my site. Very handy stuff since VP's like to look at pretty graphs for some reason.

Hope this helps
 
Well ... this is what I get for typing too late at night.

$HTTP_REFERER is not the variable I was thinking of.

The one you want to use is $REQUEST_URI

$REQUEST_URI will give you the relative URL that is currently being called with any variables passed inside the URL request.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top