I am allowing users to enter in a web address in a form, but I want to verify the address they enter. I want to ensure the web address actually exists. I am using fsockopen() and passing it the web address they enter.
the code i have is:-
$up = fsockopen("$url",80,$errno,$errstr,30);
if(!$up){
//some code
exit;
}
else{
//some code
}
But when it fails to open the web address these 2 errors appear:-
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses:
getaddrinfo failed: host/servname not known in
/cwis/WWW/USIS/wcm/departments/system/01/alias/act_external_update_htaccess
.php on line 45
Warning: fsockopen() [function.fsockopen]: unable to connect to yy:80 in
/cwis/WWW/USIS/wcm/departments/system/01/alias/act_external_update_htaccess
.php on line 45
I do not want these error messages to be displayed as this will mean absoloutely nothing to the user and I will end up with lots of phonecalls telling me the form is not working.
Any help would be greatly appreciated