Leçon N° 20 : Courrier, réseau
Envoyer un ping
***
Notes de page
Source: lesson_20_c_envoyer_un_ping.phpRésultat
<?php
$fp 
fsockopen("www.example.com"80$errno$errstr30);
if (!
$fp) {
    echo 
"$errstr ($errno)<br />\n";
} else {
    
$out "GET / HTTP/1.1\r\n";
    
$out .= "Host: www.example.com\r\n";
    
$out .= "Connection: Close\r\n\r\n";
 
    
fwrite($fp$out);
    while (!
feof($fp)) {
        echo 
fgets($fp128)."<br/>";
    }
    
fclose($fp);
}
?>



HTTP/1.1 200 OK
Content-Type: text/html
ETag: "84238dfc8092e5d9c0dac8ef93371a07:1736799080.121134"
Last-Modified: Mon, 13 Jan 2025 20:11:20 GMT
Cache-Control: max-age=2016
Date: Wed, 02 Apr 2025 22:35:50 GMT
Content-Length: 1256
Connection: close
X-N: S




Example Domain









Example Domain


This domain is for use in illustrative examples in documents. You may use this
domain in literature without prior coordination or asking for permission.


More information...







Tous droits réservés. 2005-2020