Jump to content

Run php script from another location (ip logging)


5kyy8lu3

Recommended Posts

Hi.  My buddy wants to log his ip hits to his website using my ip logging script I made.

 

Instead of porting my code over to his server, is there any way to just run my ip logging script remotely?  Assuming his host doesn't allow doing http:// in an include().

 

My buddy suggested doing a <img src="file.php"> sort of thing but would there be a way to do something similar to that without having to load an image?

 

I'm stumped and I'm open to suggestions.  None involving porting my code over though, I made a pretty in depth log of all kinds of visitor info and graphs and junk so it wouldn't be fun to port. I prefer to log stuff remotely and give him a login to my logger.

The best thing for you and your buddy would be for he to use cURL and post to your file. Your file could then process the post, and return some type of output that he could then parse. XML would be easy to generate and parse, but it could even be a csv string, or even a simple integer if that is all that is required.

  Quote

My buddy wants to log his ip hits to his website using my ip logging script I made.

 

Like skunkbad said your buddy needs to use cURL. What skunkbad however didn't said was that he has to post the user's ip address because if you would do:

 

$_SERVER['REMOTE_ADDR'];

 

You would end up logging your buddy's server ip address instead of his visitor's ip address.

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.