Jump to content
crs12decoder

php script ip/host test

Recommended Posts

Posted

am facut un script in care introduci o lista de ip-uri (introduse unu sub altul / adica despartzite prin enter) intr-un textarea si iti testeaza daca acele host-uri sunt online sau offline... (l-am facut in graba scuzati lipsa de optimizare)... have fun:


<?php
//script made by crs12decoder @ rstcenter.com
echo '
<form action="ipreg.php" method="post">
<textarea rows="20" cols="70" name="area"></textarea>
<input type="submit"><br>';
if (isset($_POST['area'])){
$ex = explode("\n", $_POST['area']);
for ($i=0; $i <$i+1; $i++){
if(!isset($ex[$i])){exit;}else{
$ion = exec('ping '.$ex[$i].' -l 1 -n 1');
$gigi = substr($ion, 0, 1);
if ($gigi == "P"){
echo "<br>$ex[$i] <font color='red'><b>nu raspunde</b></font>";}else{
echo "<br>$ex[$i] <font color='green'><b>raspunde</b></font>";}
}
}}?>

Posted
am facut un script in care introduci o lista de ip-uri (introduse unu sub altul / adica despartzite prin enter) intr-un textarea si iti testeaza daca acele host-uri sunt online sau offline... (l-am facut in graba scuzati lipsa de optimizare)... have fun:


<?php
...
for ($i=0; $i <$i+1; $i++){
if(!isset($ex[$i])){exit;}
...?>

Cam prostesc :). Faci niste operatii in plus degeaba.

Puteai folosii count:


for($i=0;i<count($ex);$i++)

P.S.: Sper sa o iei ca pe un sfat, nu ca pe un repros ;).

Guest Kenpachi
Posted

1. exec/system/passthru sunt functii care in general se tin disabled pe un host din motive de securitate.

2. ping nu e 100% eficient pentru ca masina poate fi setata sa nu raspunda la pinguri

eu unul as folosi fsockopen pe cateva porturi comune ca sa verific.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...