Current time: 12-10-2016, 07:45 PM Stay in touch via Twitter Facebook RSS Feed
Ada Baiknya anda baca Peraturan Forum ForNesia Disini Dan Disitu Sebelum Terlambat!
System Registration Forums Mulai Kedepan Sewaktu waktu akan Di Tutup.
Silahkan Dibaca Mengenai Auto Pruning User . Agar tidak ada pertanyaan lagi tentang kehilangan akses forum.



[Share] script ping in php

03-08-2014 11:05 AM script ping in php
#1


ksatria Away
Baru Belajar
Registered
*

Posts: 9
Joined: Mar 2014

Reputation:

FCoin: 2.00ƒc
silahkan di modif ulang sesuai selera

PHP Code:
<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
<
html>
<
head>
<
title>Free Ping Scriptwritten in PHP</title>
</
head>
<?
php
//  This is my first script. Enjoy.
//  
// Put it into whatever directory and call it. That's all.
// Updated to 4.2 code 
// Get Variable from form via register globals on/off
//-------------------------
$max_count 10//maximum count for ping command
$unix      =  1//set this to 1 if you are on a *unix system      
$windows   =  0//set this to 1 if you are on a windows system
// -------------------------
// nothing more to be done.
// -------------------------
//globals on or off ?
$register_globals = (bool) ini_get('register_gobals');
$system ini_get('system');
$unix = (bool) $unix;
$win  = (bool)  $windows;
//
If ($register_globals)
{
   
$ip getenv(REMOTE_ADDR);
   
$self $PHP_SELF;

else 
{
   
$submit $_GET['submit'];
   
$count  $_GET['count'];
   
$host   $_GET['host'];
   
$ip     $_SERVER['REMOTE_ADDR'];
   
$self   $_SERVER['PHP_SELF'];
};
// form submitted ?
If ($submit == "Ping!"
{
   
// over count ?
   
If ($count $max_count
   {
      echo 
'Maximum for count is: '.$max_count;
      echo 
'<a href="'.$self.'">Back</a>';
   }
   else 
   {
      
// replace bad chars
      
$hostpreg_replace ("/[^A-Za-z0-9.-]/","",$host);
      
$countpreg_replace ("/[^0-9.]/","",$count);
      echo 
'<body bgcolor="#FFFFFF" text="#000000"></body>';
      echo(
"Ping Output:<br>"); 
      echo 
'<pre>';           
      
//check target IP or domain
      
if ($unix
      {
         
system ("ping -c$count -w$count $host");
         
system("killall ping");
      }
      else
      {
         
system("ping -n $count $host");
      }
      echo 
'</pre>';
    }

else 
{
    echo 
'<body bgcolor="#FFFFFF" text="#000000"></body>';
    echo 
'<p><font size="2">Your IP is: '.$ip.'</font></p>';
    echo 
'<form methode="post" action="'.$self.'">';
    echo 
'   Enter IP or Host <input type="text" name="host" value="'.$ip.'"></input>';
    echo 
'   Enter Count <input type="text" name="count" size="2" value="4"></input>';
    echo 
'   <input type="submit" name="submit" value="Ping!"></input>';
    echo 
'</form>';
    echo 
'<br><b>'.$system.'</b>';
    echo 
'</body></html>';
}
?>
(This post was last modified: 03-08-2014 11:06 AM by ksatria.)
05-24-2014 01:13 AM RE: script ping in php
#2


droiders123 Away
HunteR
HunteR
*

Posts: 35
Joined: May 2014

Reputation:

FCoin: 102.00ƒc
nah ini dia yang ane cari , ngeping lewat cmd gagal terus..
tq gan..ketawaaa

droiders123, proud to be a member of ForNesia Family since May 2014.




Possibly Related Threads...
Thread: Author Last Post
  [Share] php script speedtest ksatria 07-01-2016 09:38 AM
Last Post: reiku
  [Info] kumpulan script premium free Brandal 11-19-2015 10:03 PM
Last Post: loji
  [Ask] Script Share FB To View Link Di Blogger zeph 12-05-2014 11:11 PM
Last Post: ravikhayyu
  [Share] php script menampilkan host ip kita ksatria 03-09-2014 09:19 PM
Last Post: ksatria

Search thread:


[-]
Advertisement