Ping a URL?

Discussion in 'PHP' started by Nerve, Oct 9, 2007.

  1. #1
    Hello, how can I send a request to a URL? For example, on my proxy site I want to ping a url (just open it in the background).

    Any help is appreciated.
     
    Nerve, Oct 9, 2007 IP
  2. madmax728

    madmax728 Banned

    Messages:
    620
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <?php
    //Set IP below
    $get = '192.168.1.1';
    //Set Count below
    $count = 10;
    if($count>10)
    { $count = 10; }
    $i=0;
    exec("ping $get -n $count",$ar);
    $set = count($ar);
    while($i < $set)
    {
    echo $ar[$i]."<br>";
    $i++;
    }
    ?>

    If you have trouble PM me..
     
    madmax728, Oct 9, 2007 IP