Forum Moderators: coopster
$fp = fsockopen("$url", 80, $errno, $errstr, 30);
if (!$fp)
{
echo "<br>The Link (URL) could ot be validated<br>
<b>You entered: $url</b><p>
<a href=\"../auth/user_edit.php\">Please try again</a><p>";
exit();
}
else
{
// then it was successful!
fclose($fp); // and carry on
}
It does the job as expected
My message is displayed but also the following warning:
Warning: fsockopen() [function.fsockopen]: unable to connect to [asdfghjkl.com:80...] (Unable to find the socket transport "http" - did you forget to enable it when you configured PHP?) in C:\wamp\www\aaaaa\url\links\submit_url.php on line 106
The rest (my message) is fine and required:
The Link (URL) could ot be validated
You entered: [asdfghjkl.com...]
Please try again
I don’t mind the warning message but do not want to show directory construction for the error might be triggered by some hack
Anyway to get rid of that message?
$fp = @fsockopen("$url", 80, $errno, $errstr, 30);