Re: Correct URL's

From: Date: Fri, 25 Jan 2002 10:12:11 +0000
Subject: Re: Correct URL's
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-82080@lists.php.net to get a copy of this message
Stefan Rusterholz wrote: > > http://www.php.net/manual/en/function.gethostbyname.php > But if I understand this function right, It will only work for URLs like > http://www.php.net/ - what if the user has a free space from > his ISP which > is located in a subdir like http://www.php.net/users/myhome/? If you want to check subdirs you have to connect to the URL and look at the response. You should use gethostbyname to check the domain (use some regular expressions on the URL) and then try to connect to the server and send a HTTP request (fsockopen and some other functions). Then you can check the response for error messages like 404. Alexander

« previous php.general (#82080) next »