bluephoenix
02-10-2003, 08:42 PM
It seems that this forum will be my new home for a few days... but that's okay, ya'll seem like a nice enough group of people. :)
I want to write a short php script to act as a rudimentary stats gatherer. I'm thinking along the lines of writing one script, then including it in all the other pages. In other words, say I have index.shtml, about.shtml, and contact.php. I would like one script, stats.php, that I can use on the different pages (either by <!--#include file="php/stats.php"--> or include ("php/stats.php"); depending on how the page is parsed).
It'll just dump all the data in the same file, something along the lines of:
1. index.shtml 123.45.6.789 refr: yahoo.com Mozilla /4.0
2. contact.php 123.45.6.789 refr: index.shtml Mozilla /4.0
3. index.shtml 987.65.43.210 refr: google.com Opera 6.0
4. index.shtml 123.45.6.789 refr: contact.php Mozilla /4.0
5. about.shtml 987.65.43.210 refr: index.shtml Opera 6.0
...
But to do that I'll need the page name into which the the script was included. I can't just use $PHP_SELF because it'll just return the name of the script, not the page (I even checked to see if there was a $HTTP_SELF... no luck).
What variable am I looking for to find the name of the page in which stats.php has been inserted?!
Thanks.
I want to write a short php script to act as a rudimentary stats gatherer. I'm thinking along the lines of writing one script, then including it in all the other pages. In other words, say I have index.shtml, about.shtml, and contact.php. I would like one script, stats.php, that I can use on the different pages (either by <!--#include file="php/stats.php"--> or include ("php/stats.php"); depending on how the page is parsed).
It'll just dump all the data in the same file, something along the lines of:
1. index.shtml 123.45.6.789 refr: yahoo.com Mozilla /4.0
2. contact.php 123.45.6.789 refr: index.shtml Mozilla /4.0
3. index.shtml 987.65.43.210 refr: google.com Opera 6.0
4. index.shtml 123.45.6.789 refr: contact.php Mozilla /4.0
5. about.shtml 987.65.43.210 refr: index.shtml Opera 6.0
...
But to do that I'll need the page name into which the the script was included. I can't just use $PHP_SELF because it'll just return the name of the script, not the page (I even checked to see if there was a $HTTP_SELF... no luck).
What variable am I looking for to find the name of the page in which stats.php has been inserted?!
Thanks.