Question

I have website visitors requesting my PHP file including variables in the URL:

http://www.mywebsite.com/file.php?somevariable=blabla&othervariable=and so on

Is there a way to "track" or record the dynamic URL, maybe with IP adress so the output would look like this:

IP: 12.345.33.234 
URL:http://www.mywebsite.com/file.php?somevariable=blabla

IP: 12.345.678.234
URL:http://www.mywebsite.com/file.php?somevariable=blabla
URL:http://www.mywebsite.com/file.php?somevariable=blabla

and so on

I tried Google analytics but I can't make heads or tail out of it. I Googled a lot but Im not sure what Im looking for...which makes searching difficult.

Was it helpful?

Solution

If you don't feel like apache's the way to go for some reason, you can create a database table to store requests in. Where you would save the IP and the current url which you can easily access with document.URL in javascript. Have in mind though that many computers may have the same IP within a given network, so if you'll be serving punishment for some kind of abuse, IP is not necessarily the way to go. Hope that helped, good luck! :P

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top