Search the Community
Showing results for tags 'webadress'.
-
<html><center><br><br><br>checks with get headers <form action="#" method="post"> <input type="text" name="webadres" value=" " required> <br> <input type="submit" value="Send" ><br><br><br> </form> <?php if ($_SERVER['REQUEST_METHOD'] == 'POST'){ $sites= $_POST['webadres']; var_dump($sites); if (isset($sites)) { var_dump(get_headers($sites)); } ?> <br><br>Checks with curl get info <?php $url = curl_init($sites); curl_setopt($url, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($url); $info = curl_getinfo($url); print_r($info); curl_close($url); } ?> </html> I made above script to test whether a webadress exists or not. I'm very surprised that a lot of inputs dont give any result, they actually give a php error message. using sites like http://www.facebook.com does not work, for it twitter it runs. pinterest does only run http and not https. I also found sites like http://www.bbc.co.uk or http://www.cnn.com and more giving no result. Can someone explain why this happens and how to securily check the existance of a website.
- 5 replies
-
- curl
- get_headers
-
(and 3 more)
Tagged with: