Forum Moderators: coopster

Message Too Old, No Replies

Checking url

if exists....

         

omoutop

11:56 am on Jan 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi to all and a Happy New Year!

Is there any way to check if a particular url/page exists using php, for instance check within my script if [webmasterworld.com...] exists and act accordingly (big IF)

thx in advance

omoutop

12:02 pm on Jan 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



linkinfo()mightbe my solution....i'll try it out, if u have a better idea/solution plz tell me!

jetboy

12:24 pm on Jan 2, 2006 (gmt 0)

10+ Year Member



Check out [uk.php.net ] - a PHP library that allows you to use various different web protocols, including HTTP.

A few lines of code will allow you to access a web page in the same way a browser would. One of the things you can bring back to PHP is the HTTP header information, including the response code. (200 OK, 404 Not Found etc). This will give you the information you're after.

omoutop

12:31 pm on Jan 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



thx very much jetboy, o'll take a look over there!