Jump to content


Photo

Echo debug statements won't show up in Firefox.


  • Please log in to reply
4 replies to this topic

#1 dmcalerney

dmcalerney
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 01 March 2006 - 10:10 PM

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

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 01 March 2006 - 10:15 PM

[!--quoteo(post=350803:date=Mar 1 2006, 10:10 PM:name=dmcalerney)--][div class=\'quotetop\']QUOTE(dmcalerney @ Mar 1 2006, 10:10 PM) View Post[/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.

#3 dmcalerney

dmcalerney
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 01 March 2006 - 11:42 PM

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
<?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>

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?




#4 mainewoods

mainewoods
  • Members
  • PipPipPip
  • Advanced Member
  • 685 posts
  • LocationMaine

Posted 02 March 2006 - 01:37 AM

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.

#5 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 02 March 2006 - 04:11 AM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users