Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Ping
Forum PHP.pl > Forum > PHP
N3t
Witam, mam takie napisałem prosty skrypcik, oto on:
Cytat
<?php
$ping = system("ping 62.233.177.126, -1");
print("Pinging 62.233.177.126: nn $ping");
?>

I chodzi o to,że on działa ale nie zwraca wyniku pinga dlaczego questionmark.gif? Gdzie jest błąd, thx z góry.
GeoS
Cytat
string system ( string command [, int return_var])


system() is just like the C version of the function in that it executes the given command and outputs the result. If a variable is provided as the second argument, then the return status code of the executed command will be written to this variable.
N3t
Thx, ale i tak nic to nie dało, zmieniam skrypt na:
Cytat
<?php
system("ping 62.233.177.126, $result");
print("Pinging 62.233.177.126: nn $result");
?>

Skrypt działa, ale wciąż nie ma żadnego rezultatu, żadnych wyników. Co jest nie tak ?
Seth
8O biggrin.gif laugh.gif rolleyes.gif
Kod
<?php

system("ping 62.233.177.126", $result);

print("Pinging 62.179.16.112: nn $result");

?>


ma byc: "ping 62.233.177.126", $result,
a nie: "ping 62.233.177.126, $result"
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.