|
Posted by shimmyshack on 11/02/07 15:34
On Nov 2, 3:25 pm, "Shelly" <sheldonlg.n...@asap-consult.com> wrote:
> shimmyshack wrote:
> > On Nov 2, 3:02 pm, "Shelly" <sheldonlg.n...@asap-consult.com> wrote:
> >> I have been starting and staring at this code snippet and can't seem
> >> to find anything. Maybe another pair of eyes can. Here is the
> >> snippet:
>
> >> $i = 0;
> >> $html = '<body><table border="1" align="center"><tr><td colspan="2"
> >> align="center"><b>' . $title . '</b></td></tr>';
> >> foreach ($fields as $field) {
> >> $fieldValue[$field] = $_POST[$field];
> >> $html .= '<tr><td><b>' . $fieldDisplay[$i] . '</b></td>><td>' .
> >> $fieldValue[$field] . '</td></tr>';
> >> $i++;}
>
> >> $html .= '</table></body>';
> >> var_dump($html);
>
> >> The table gets output correctly, but before the table there appear a
> >> number of lines with only a ">" at the top, aligned with the left
> >> edge of the table. The number of lines is equal to the number of
> >> times through the loop (not including the first line before the
> >> loop). That is, if there are 9 fields, then the table has 10 rows
> >> and there appeare 9 ">" before the table. The values of
> >> $fieldDisplay[$i] and $fieldValue[$field] appear correctly in the
> >> table.
>
> >> Where is it picking up that extra ">"?
>
> >> --
> >> Shelly
>
> > its here:
>
> > $html .= '<tr><td><b>' . $fieldDisplay[$i] . '</b></td>><td>' .
>
> > see </td>> at the end,
>
> Thanks. That is what I needed, another pair of eyes.
>
>
>
> > but your table should have table heading and body as well to be
> > properly accessibile.
>
> Aren't the <tr><td> things the body? I guess I could have used <th> for the
> first column and <caption> for the title.
>
> Thanks again.
>
> --
> Shelly- Hide quoted text -
>
> - Show quoted text -
oh and please please please use htmlentities or you will be XSS'd to
death
Navigation:
[Reply to this message]
|