Page 1 of 1

URL Checking

Posted: Sat Jul 24, 2004 4:44 am
by gopher
I've made a script where a user can add an image (or image information rather) to a database.

Now what I need to know, is if there is a way that I can check that an entered URL actually exists, I don't want them to be able to link to an image that does not exist.

Posted: Sat Jul 24, 2004 4:51 am
by JAM
Perhaps the following might be of use. Tweak and add more to fit your solution.

Code: Select all

<?php
    if($foo = @getimagesize('http://forums.devnetwork.net/templates/subSilver/images/logo_phpBB.gif')) {
        echo '<pre>';
        print_r($foo);
        echo '</pre>';
    }
?>