Page 1 of 1

[SOLVED] checking if a url exists

Posted: Sun Mar 14, 2004 7:36 am
by sh33p1985
after stripping all the links from a webpage and again stripping the hrefs from the links and storing them in an array. i want to check to see if the urls exist (they are absolute) and if not echo "href doesnt exist" and echo "href does exist" if they do. how can in do this?

Posted: Sun Mar 14, 2004 7:57 am
by sh33p1985
also, im having problems with file_get_contents("http://etc");
get an error message when calling the function:

Fatal error: Call to undefined function: file_get_contents

anyone know why this is?

Posted: Sun Mar 14, 2004 8:07 am
by TheBentinel.com
sh33p1985 wrote: Fatal error: Call to undefined function: file_get_contents
Sounds like you might be on an older version of PHP. file_get_contents was introduced in 4.0. I believe you can see your version and other stuff by saying:

print (php_info());

You will probably need to look into using fopen:

http://www.php.net/fopen

Posted: Sun Mar 14, 2004 8:52 am
by sh33p1985
nah its 4.2.3, works on me mates machine but not on mine. strange