Jump to content

Echo debug statements won't show up in Firefox.


dmcalerney

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
Link to comment
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.
Link to comment
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?


Link to comment
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.
Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.