OpenMedia
Lieutenant
- Registriert
- Okt. 2016
- Beiträge
- 706
Guten Tag zusammen,
und zwar habe ich eine Seite wo folgendes Script läuft :
Wenn ich nun das Script nochmal reinschreibe sprich 2x mal dann läuft die Seite nicht mehr ? Warum auch wenn ich die URL die er anpingen soll ändere kriege ich nur eine blanke Seite
Also wenn ich so mache :
und zwar habe ich eine Seite wo folgendes Script läuft :
PHP:
<?php
function ping($host, $port, $timeout) {
$tB = microtime(true);
$fP = fSockOpen($host, $port, $errno, $errstr, $timeout);
if (!$fP) { return "down"; }
$tA = microtime(true);
return round((($tA - $tB) * 1000), 0)." ms";
}
//Echoing it will display the ping if the host is up, if not it'll say "down".
echo ping("http://google.de", 80, 1);
?>
Wenn ich nun das Script nochmal reinschreibe sprich 2x mal dann läuft die Seite nicht mehr ? Warum auch wenn ich die URL die er anpingen soll ändere kriege ich nur eine blanke Seite
Also wenn ich so mache :
PHP:
<?php
function ping($host, $port, $timeout) {
$tB = microtime(true);
$fP = fSockOpen($host, $port, $errno, $errstr, $timeout);
if (!$fP) { return "down"; }
$tA = microtime(true);
return round((($tA - $tB) * 1000), 0)." ms";
}
//Echoing it will display the ping if the host is up, if not it'll say "down".
echo ping("http://google.de", 80, 1);
?>
<?php
function ping($host, $port, $timeout) {
$tB = microtime(true);
$fP = fSockOpen($host, $port, $errno, $errstr, $timeout);
if (!$fP) { return "down"; }
$tA = microtime(true);
return round((($tA - $tB) * 1000), 0)." ms";
}
//Echoing it will display the ping if the host is up, if not it'll say "down".
echo ping("http://google.de", 80, 1);
?>