I am working on a project where someone will install my code on their server and it will collect certain information held in their database and then report that information back to me.

I am trying to figure out the best way to go about this using php to report this data back.

Basically the script will run every day on their server. The script will collect information that I wish to have sent back to my server and then logged in my database. I have no problem with actually collecting the information. My issue is how to get it transfered back to my server in a secure manner where I am the only one that will be able to access this information.

The first and best method that I can think of would be to setup a REST api on your server that the script on someone elses server would send a POST request to with credentials. You can serve the REST api over SSL and require credentials to post to it. The company I work for captures analytics data from mobile devices and it is transfered to us this way from their mobile app.

It isn't the easiest thing in the world to setup a REST api but it is the best most current method in my opinion.

It isn't the easiest thing in the world to setup a REST api

Restler can help with that.

Thanks pritaeas, good information there.