Re: How can I securely send a url with GET info from a crontab php script to another server?
| From: | Marek Kilimajer | Date: | Mon, 05 May 2003 11:13:30 +0000 |
| Subject: | Re: How can I securely send a url with GET info from a crontab php script to another server? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146420@lists.php.net to get a copy of this message | ||
Daevid Vincent wrote:
I have a client PHP script I'm writing that will execute via crontab. I need it to collect some info about the system (cpu, ram, hd, uptime, etc) and then send it to another server on the internet where I can log the info into a mysql database. I was thinking a url like so: http://checkin.mycompany.com/checkin.php?cpu=1000&ram=256&uptime=1.0,2.0,3.0 &.... My first question is, how do I actually do that the best way? Shall I use the header() or fopen() or fsockopen()? Simple fopen('http://checkin.mycompany.com/.....'); is good if allow_url_fopen is on
I was thinking I could also encrypt the whole string somehow so it would be like http://checkin.mycompany.com/checkin.php?info=ap34um5sfo85s5o8sop58sp84a84y5 8ay4nay984nyf0a9ny40 (Then just split it back out on the server end again based upon my algorithm.) Check mcrypt functions, the example is straightforward, but you need it installed
Or is it better to simulate a form post (GET/POST) simulation somehow? And if so, how can I 'secure' that? My apache server has https:// enabled. https is the best bet, but it needs to be enabled on the other end. You need its public key.
The key here is that the 'clients' might be behind firewalls, and so it's most likely that port 80 will be open. Working examples (links/code) greatly appreciated.