July 29, 2004

PHP 2

OK so I cheated a bit and got Ed to write a script to give me a unique visitor counter collated from the stats running on the server... it worked so well he used it on his site too ;-)

Anyway, today I've had a go at fiddling with his script to show what the most common search phrase is of the current month that visitors find my site with. Apart from having to learn a little PHP, the most annoying thing was that both Ed's script and mine would work fine seperately, but not on the same page (they were voiding the following ones variables)... grr I thought, then finally tried changing one of the function's name... seems you can't have 2 includes that both use an identical named function on the same page (dispite the functions being in 2 totally seperate PHP scripts) - with that changed all is working perfectly ;-)
Posted by Antony on July 29, 2004 06:54 PM | TrackBack
Comments

That's cause it doesn't run the PHP script as the includes and then include it, it includes the lot into one file and then parses it as one.

Posted by: Ed at July 31, 2004 02:12 PM

UPDATE: It seems my magic script hadn't accounted for those first few hours of each month when there isn't actually a top search phrase (so it displays a kinda useless result instead) - well that's been sorted now too ;-)

Posted by: Ant at August 1, 2004 11:11 AM
Post a comment









Remember personal info?




Copy this security code into the box next to it to post a comment.
Security Code