I would like to make a php program that will take a list of URLs in all of my site's web pages and somehow "ping" (for lack of a better word) each site and return a value if they are still active.
I've seen services on the web that do this but there is always some shortcoming on them that I would like to fix. I have several books on php but honestly I don't even know where to begin for something like this. It must be possible. What commands should I start to look at (and learn about)?
TIA
Steve
Checking Links with php code
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
php 5 has get_headers(), and you can use curl in php 4 to do the same thing, or fsockopen() if you're feeling daring.
Just for pinging, wouldnt gethostbyname do the job ?
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
That would do a DNS lookup, not touch the server.anjanesh wrote:Just for pinging, wouldnt gethostbyname do the job ?
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida