Forum Moderators: coopster
Any suggestions as to how I can tell if a particular URL is not functioning at a particular time?
I'm currently trying to devise a script to send out a notification email if a particular URL is not working.... if the server is down, or if for some reason the URL returns an error or some.
Use curl in a cron job.
Logic is
$result = curl url
if (preg_match('/error/im',$result) or preg_match('/not found/im',$result)) { send_error_mail($result); }
In send_error_mail you'd add all environment and input variables as well as the curl'ed result, get as much info as you can.
Another is to use curl just to get at the headers, see the php.net documentation on using curl.
Thanks rockenbil, I'll look into that.
Also, would anyone know of any existing application with similar funcationality that I could lookover?