Print PHP Output Line By Line

Discussion in 'PHP' started by Linkbait, Jun 28, 2007.

  1. #1
    Is there any way to output each line of PHP as it is executed without using the command line?

    For example, lets say I am building a small vulnerability tester in PHP that checks a URL for vulnerabilities. The check uses a function that either outputs Yes, or No. instead of having to wait for the whole page to load, is there a way to print them out one at a time as they are checked?

    Thanks.
     
    Linkbait, Jun 28, 2007 IP
  2. Nefarious

    Nefarious Peon

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I wanted the same thing long time ago. If I remember right it depends on the browser if it will display line per line.

    after you echo the line use these 2 lines:

    ob_flush();
    flush();

    See if that does what you want.
     
    Nefarious, Jun 28, 2007 IP
  3. Linkbait

    Linkbait Peon

    Messages:
    373
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Trying that right now, thanks.
     
    Linkbait, Jun 28, 2007 IP
  4. Linkbait

    Linkbait Peon

    Messages:
    373
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #4
    :( lol

    Notice: ob_flush(): failed to flush buffer. No buffer to flush.
     
    Linkbait, Jun 28, 2007 IP
  5. Linkbait

    Linkbait Peon

    Messages:
    373
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Update, dont worry about. I decided to scrap that idea and just go with AJAX.

    Thanks for the attempt though.
     
    Linkbait, Jun 28, 2007 IP