Hello,
remember a few points . it is not xhtml compliant to write html code
that doesnt include "" in it.. <img cellpadding="0" /> is valid xhtml
as <img cellpadding=0 /> is not.
in php print will interp. anything between " " looking for $variables
echo does not. this is slower than using echo and concatinating.
yeah its neat to break up your <? php open and closing tags.. but
sometimes this gets annoying. so my suggestion is something like this:
echo '<input type="text" name="addr" size="30" maxlength="30"
value="'.$row['addr'].'" />';
and please for the love of god its $row['addr'] not $row[addr]
i hope this was helpful :)
- Jonathan P Dryhurst Roberts
newsgroup@black-panther.freeserve.co.uk (James) wrote in message news:<3effdcaf.368360604@news.freeserve.com>...
> On Mon, 30 Jun 2003 18:20:18 +1200, James Sleeman
> <james@seeMessageForDomain.moc> scrawled:
>
> >S. Rhodes wrote:
> >
> >> <input type=text name=addr size=30 maxlength=30 value='".$row[addr]."'>
> >> In the above code, D'linda is stored in $row[addr].
> >
> >Use <input type=text name=addr size=30 maxlength=30
> >value=\"".htmlspecialchars($row[addr])."\">
> >
>
> Use PHP as it's supposed to, and don't just "print" everything...
> then you can produce good HTML....
>
> ?>
> <input type="text" name="addr" size="30" maxlength="30"
> value="<?= htmlspecialchars( $row["addr"] )?>" />
> <?