Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #7492 > unrolled thread

Order of Echoed HTML Output

Started bybobgatski@gmail.com
First post2012-11-07 10:04 -0800
Last post2012-11-08 14:01 -0500
Articles 8 — 5 participants

Back to article view | Back to comp.lang.php


Contents

  Order of Echoed HTML Output bobgatski@gmail.com - 2012-11-07 10:04 -0800
    Re: Order of Echoed HTML Output Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-11-07 14:32 -0500
      Re: Order of Echoed HTML Output The Natural Philosopher <tnp@invalid.invalid> - 2012-11-07 20:39 +0000
    Re: Order of Echoed HTML Output The Natural Philosopher <tnp@invalid.invalid> - 2012-11-07 20:38 +0000
    Re: Order of Echoed HTML Output Denis McMahon <denismfmcmahon@gmail.com> - 2012-11-08 01:14 +0000
      Re: Order of Echoed HTML Output Doug Miller <doug_at_milmac_dot_com@example.com> - 2012-11-08 19:06 +0000
    Re: Order of Echoed HTML Output bobgatski@gmail.com - 2012-11-08 10:14 -0800
      Re: Order of Echoed HTML Output Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-11-08 14:01 -0500

#7492 — Order of Echoed HTML Output

Frombobgatski@gmail.com
Date2012-11-07 10:04 -0800
SubjectOrder of Echoed HTML Output
Message-ID<2e1af12b-a4a3-4b77-9bc4-2e790a9a6270@googlegroups.com>
I have this code in a simple php file ...

$which_table_to_dump = "Publisher_Records";
require ('table2html-i-withbuttons.php');

echo "<br/>back from table2html-i-withbuttons.php<br/>";

...  The file, table2html-i-withbuttons.php (an earlier version was called 'dumptable'), simply outputs, using echo, the right html table tags, and data from the table, to display the table (specified by the variable $which_table_to_dump. 
 
My confusion and problem is that the echo ("back from ...") appears in the browser window ABOVE the table!  

Can anyone explain why that is?  

Thanks,  Bob

[toc] | [next] | [standalone]


#7493

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-11-07 14:32 -0500
Message-ID<9Hyms.15959$zu4.10482@newsfe14.iad>
In reply to#7492
On 11/7/12 1:04 PM, bobgatski@gmail.com wrote:
> I have this code in a simple php file ...
>
> $which_table_to_dump = "Publisher_Records";
> require ('table2html-i-withbuttons.php');
>
> echo "<br/>back from table2html-i-withbuttons.php<br/>";
>
> ...  The file, table2html-i-withbuttons.php (an earlier version was called 'dumptable'), simply outputs, using echo, the right html table tags, and data from the table, to display the table (specified by the variable $which_table_to_dump.
>
> My confusion and problem is that the echo ("back from ...") appears in the browser window ABOVE the table!
>
> Can anyone explain why that is?
>
> Thanks,  Bob
>
If a <table> isn't properly closed, then it all bets are off. You can 
view-source to verify that your "back from" happens in the right place. 
  Then you simply have to fix the HTML in your table2html-i-withbuttons.php"

[toc] | [prev] | [next] | [standalone]


#7495

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-11-07 20:39 +0000
Message-ID<k7egt5$6c6$2@news.albasani.net>
In reply to#7493
On 07/11/12 19:32, Daniel Pitts wrote:
> On 11/7/12 1:04 PM, bobgatski@gmail.com wrote:
>> I have this code in a simple php file ...
>>
>> $which_table_to_dump = "Publisher_Records";
>> require ('table2html-i-withbuttons.php');
>>
>> echo "<br/>back from table2html-i-withbuttons.php<br/>";
>>
>> ...  The file, table2html-i-withbuttons.php (an earlier version was
>> called 'dumptable'), simply outputs, using echo, the right html table
>> tags, and data from the table, to display the table (specified by the
>> variable $which_table_to_dump.
>>
>> My confusion and problem is that the echo ("back from ...") appears in
>> the browser window ABOVE the table!
>>
>> Can anyone explain why that is?
>>
>> Thanks,  Bob
>>
> If a <table> isn't properly closed, then it all bets are off. You can
> view-source to verify that your "back from" happens in the right place.
>   Then you simply have to fix the HTML in your
> table2html-i-withbuttons.php"
+1


-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to 
lead are elected by the least capable of producing, and where the 
members of society least likely to sustain themselves or succeed, are 
rewarded with goods and services paid for by the confiscated wealth of a 
diminishing number of producers.

[toc] | [prev] | [next] | [standalone]


#7494

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-11-07 20:38 +0000
Message-ID<k7egsl$6c6$1@news.albasani.net>
In reply to#7492
On 07/11/12 18:04, bobgatski@gmail.com wrote:
> I have this code in a simple php file ...
>
> $which_table_to_dump = "Publisher_Records";
> require ('table2html-i-withbuttons.php');
>
> echo "<br/>back from table2html-i-withbuttons.php<br/>";
>
> ...  The file, table2html-i-withbuttons.php (an earlier version was called 'dumptable'), simply outputs, using echo, the right html table tags, and data from the table, to display the table (specified by the variable $which_table_to_dump.
>
> My confusion and problem is that the echo ("back from ...") appears in the browser window ABOVE the table!
>
> Can anyone explain why that is?
>

cos your HTML is corrupt. Always view source as a first thing.

> Thanks,  Bob
>


-- 
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to 
lead are elected by the least capable of producing, and where the 
members of society least likely to sustain themselves or succeed, are 
rewarded with goods and services paid for by the confiscated wealth of a 
diminishing number of producers.

[toc] | [prev] | [next] | [standalone]


#7499

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2012-11-08 01:14 +0000
Message-ID<k7f116$4bh$1@dont-email.me>
In reply to#7492
On Wed, 07 Nov 2012 10:04:23 -0800, bobgatski wrote:

> I have this code in a simple php file ...
> 
> $which_table_to_dump = "Publisher_Records";
> require ('table2html-i-withbuttons.php');
> 
> echo "<br/>back from table2html-i-withbuttons.php<br/>";
> 
> ...  The file, table2html-i-withbuttons.php (an earlier version was
> called 'dumptable'), simply outputs, using echo, the right html table
> tags, and data from the table, to display the table (specified by the
> variable $which_table_to_dump.
>  
> My confusion and problem is that the echo ("back from ...") appears in
> the browser window ABOVE the table!
> 
> Can anyone explain why that is?

The only place inside a table that content can appear is inside a cell 
within the table (ie inside a td or th).

If you're outputting text outside of the cells but inside the table 
structure, then the browser will try and interpret your misplaced text 
according to the whims of whoever coded it.

Use the "view source" option of the web browser to see what html is 
actually being generated.

Save the following (invalid) html as a file and open it in your browser 
if you want to investigate the whims of the coders of your browser.

<html>
<head>
<title>Broken Table</title>
</head>
<body>
<table>
text before the rows
<tr>
text before the header cells
<th>header cell 1</th>
text between the header cells
<th>header cell 2</th>
text after the header cells
</tr>
text between the rows
<tr>
text before the cells
<th>cell 1</th>
text between the cells
<th>cell 2</th>
text after the cells
</tr>
text after the rows
</table>
</body>
</html>

In my firefox, all the wrongly positioned text is concatenated with 
intervening whitespace into a single text node prior to the table.

Rgds

Denis McMahon

[toc] | [prev] | [next] | [standalone]


#7502

FromDoug Miller <doug_at_milmac_dot_com@example.com>
Date2012-11-08 19:06 +0000
Message-ID<XnsA1058F7D1B305dougmilmaccom@88.198.244.100>
In reply to#7499
Denis McMahon <denismfmcmahon@gmail.com> wrote in news:k7f116$4bh$1@dont-
email.me:

[...]
> In my firefox, all the wrongly positioned text is concatenated with 
> intervening whitespace into a single text node prior to the table.

Likewise in Safari and Opera.

[toc] | [prev] | [next] | [standalone]


#7500

Frombobgatski@gmail.com
Date2012-11-08 10:14 -0800
Message-ID<206d328f-029e-40bc-9966-1966b934f305@googlegroups.com>
In reply to#7492
On Wednesday, November 7, 2012 1:04:23 PM UTC-5, bobg...@gmail.com wrote:
> I have this code in a simple php file ...
> 
> 
> 
> $which_table_to_dump = "Publisher_Records";
> 
> require ('table2html-i-withbuttons.php');
> 
> 
> 
> echo "<br/>back from table2html-i-withbuttons.php<br/>";
> 
> 
> 
> ...  The file, table2html-i-withbuttons.php (an earlier version was called 'dumptable'), simply outputs, using echo, the right html table tags, and data from the table, to display the table (specified by the variable $which_table_to_dump. 
> 
>  
> 
> My confusion and problem is that the echo ("back from ...") appears in the browser window ABOVE the table!  
> 
> 
> 
> Can anyone explain why that is?  
> 
> 
> 
> Thanks,  Bob

Thank you VERY much to the several responders.  I guess I shouldn't be surprised that my html was messed up.  I was surprised that a fairly innocent mistake could result in out of order output.

Thanks again, I appreciate your help.

Bob

[toc] | [prev] | [next] | [standalone]


#7501

FromDaniel Pitts <newsgroup.nospam@virtualinfinity.net>
Date2012-11-08 14:01 -0500
Message-ID<0kTms.35958$MP7.2383@newsfe05.iad>
In reply to#7500
On 11/8/12 1:14 PM, bobgatski@gmail.com wrote:
> On Wednesday, November 7, 2012 1:04:23 PM UTC-5, bobg...@gmail.com wrote:
>> I have this code in a simple php file ...
>>
>>
>>
>> $which_table_to_dump = "Publisher_Records";
>>
>> require ('table2html-i-withbuttons.php');
>>
>>
>>
>> echo "<br/>back from table2html-i-withbuttons.php<br/>";
>>
>>
>>
>> ...  The file, table2html-i-withbuttons.php (an earlier version was called 'dumptable'), simply outputs, using echo, the right html table tags, and data from the table, to display the table (specified by the variable $which_table_to_dump.
>>
>>
>>
>> My confusion and problem is that the echo ("back from ...") appears in the browser window ABOVE the table!
>>
>>
>>
>> Can anyone explain why that is?
>>
>>
>>
>> Thanks,  Bob
>
> Thank you VERY much to the several responders.  I guess I shouldn't be surprised that my html was messed up.  I was surprised that a fairly innocent mistake could result in out of order output.
>
> Thanks again, I appreciate your help.
Tables are the only place I've seen this, but I have seen it several 
times, so that's why I will always suspect that first when I see 
"out-of-order" output.  This will probably be true for you now too :-)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web