Find the answer to your Linux question:
Results 1 to 3 of 3
Hello to all, I have a problem, I want to show the ping in my web browser, but when I implement the code, it process it first, then shows it, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2009
    Posts
    19

    ping in web browser


    Hello to all,

    I have a problem, I want to show the ping in my web browser, but when I implement the code, it process it first, then shows it, I mean...the browser waits until all the pings are done and then it shows all of them like a static web page and not like running a ping from a terminal.

    How can i solve that problem??...this are the lines of code that i have implemented:

    if ($unix)
    {
    system ("ping -c$count -w$count $host");
    system("killall ping");// kill all ping processes in case there are some stalled ones or use echo 'ping' to execute ping without shell
    }
    else
    {
    system("ping -n $count $host");
    }
    echo '</pre>';



    is anything wrong with that??

    tks for your answers

  2. #2
    Just Joined!
    Join Date
    Jun 2010
    Posts
    2
    Hello,

    that's totally normal. PHP is a server side language and it treats the informations you send and then send back a result in on time.

    If you want to get the data in real time from the server, you have to go through some Ajax. You will probably get more help on a forum about web programming

    Hope this helps.

  3. #3
    Just Joined!
    Join Date
    Oct 2009
    Posts
    19
    Xzan

    tks a lot, i'll check it out on ajax

    regards,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •