note 81858 added to function.echo
| From: | nando_f at nothingsimple dot com | Date: | Sun, 16 Mar 2008 21:13:46 +0000 |
| Subject: | note 81858 added to function.echo | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137112@lists.php.net to get a copy of this message | ||
I used to use echo like this because I thought it
neat and easier to read.
<?
echo
"<TABLE>",
"<TR>",
"<TD>COLUMN A</TD>",
"<TD>COLUMN BA</TD>",
"<TD>COLUMN C</TD>",
"<TD>COLUMN D</TD>",
"<TD>COLUMN E</TD>",
"</TR>",
"</TABLE";
?>
Until, one day, I noticed that the HTML was injected with misterious
8 characters in the middle of the HTML stream.
Using packet capture I discovered that the first 2 and last 2 bytes
were always OD OA (cr & lf) and the middle 4 were something
similar to '206e'. The very odd thing is that the first OD OA was
always at the end of a network packet and the remaining 6 were
at the beginning of the following network packet. It was happening
approximately every 5 to 10 running of the scripts and was random.
So, Instead, I tried using concatenation replacing large chunks
where echo was...
<?
$echo="<TABLE>";
$echo.="<TR>";
$echo.="<TD>COLUMN A</TD>";
$echo.="<TD>COLUMN BA</TD>";
$echo.="<TD>COLUMN C</TD>";
$echo.="<TD>COLUMN D</TD>";
$echo.="<TD>COLUMN E</TD>";
$echo.="</TR>";
$echo.="</TABLE";
echo $echo;
?>
The issue disappeared AND it works faster! :)
I hope this helps someone with similar issues
nando_f@nothingsimple.com
----
Server IP: 69.147.83.197
Probable Submitter: 207.164.141.163
----
Manual Page -- http://www.php.net/manual/en/function.echo.php
Edit -- https://master.php.net/note/edit/81858
Del: integrated -- https://master.php.net/note/delete/81858/integrated
Del: useless -- https://master.php.net/note/delete/81858/useless
Del: bad code -- https://master.php.net/note/delete/81858/bad+code
Del: spam -- https://master.php.net/note/delete/81858/spam
Del: non-english -- https://master.php.net/note/delete/81858/non-english
Del: in docs -- https://master.php.net/note/delete/81858/in+docs
Del: other reasons-- https://master.php.net/note/delete/81858
Reject -- https://master.php.net/note/reject/81858
Search -- https://master.php.net/manage/user-notes.php