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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.