Jump to content

Archived

This topic is now archived and is closed to further replies.

dmcalerney

Echo debug statements won't show up in Firefox.

Recommended Posts

I've got this script where it does some calculations and at the end it calls itself again. In internet explorer, all of my echo statements that I'm using for debugging are showing up on the screen. They don't show up when I'm using firefox. Does anyone else know what's up with this?


Thanx,
Danny

Share this post


Link to post
Share on other sites
[!--quoteo(post=350803:date=Mar 1 2006, 10:10 PM:name=dmcalerney)--][div class=\'quotetop\']QUOTE(dmcalerney @ Mar 1 2006, 10:10 PM) [snapback]350803[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I've got this script where it does some calculations and at the end it calls itself again. In internet explorer, all of my echo statements that I'm using for debugging are showing up on the screen. They don't show up when I'm using firefox. Does anyone else know what's up with this?
Thanx,
Danny
[/quote]
It might help if you posted the offending script.

Share this post


Link to post
Share on other sites
I didn't post a script because it's happining on a lot of mine. Here's a generic (and otherwise useless) example of my scripts.



this is called my_script.php
[code]<?php

session_start();
header("Cache-control: private");
include("functions.php");


$taco = $_SESSION['taco'];
$taco_count = $_SESSION['taco_count'];

echo "Here is taco: $taco<br>";
$taco_count++;

$_SESSION['taco_count'] = $taco_count;
?>

<html>

    <head>
    
        <script LANGUAGE="JavaScript">
            window.location="my_script.php";
        </script>
        --/>
    </head>
</html>[/code]

In IE I'll See this:(assuming I defined taco in an earlier script)

Here is taco: Chicken

And I'd see that every time the script calls itself. But in firefox, it won't display that line.

Know what I mean?


Share this post


Link to post
Share on other sites
It must be because this statement: echo "Here is taco: $taco<br>";
is before your <html> tag and firefox doesn't like that. It would display in firefox if you put in a <body> tag and put it after that. What you have is basically invalid html and IE is more forgiving of invalid html. No problem with the echo statement, a problem with invalid html.

Share this post


Link to post
Share on other sites
No, that's not it. I have many scripts that output debugging text before the <html> tag and they all work fine in both MSIE & FF. What's probably happening is that the output is being buffered is never getting actually written to the screen. Try using the [a href=\"http://www.php.net/flush\" target=\"_blank\"]flush[/a]() function after your debug output.

Ken

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.