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=370
Date: Sat, 03 May 2025 19:08:08 GMT
Content-Length: 1256
Connection: close




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