note 81858 rejected from function.echo by felipe

From: Date: Sat, 29 Mar 2008 15:40:07 +0000
Subject: note 81858 rejected from function.echo by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-137711@lists.php.net to get a copy of this message
Note Submitter: nando_f at nothingsimple dot com ---- 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

« previous php.notes (#137711) next »