Re: Re: Inserting querydata as default value in form
| From: | John W. Holmes | Date: | Wed, 28 Jan 2004 21:26:15 +0000 |
| Subject: | Re: Re: Inserting querydata as default value in form | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-32688@lists.php.net to get a copy of this message | ||
From: "Neil Smth" <php@comatose.freeserve.co.uk>
> When will people learn that attributes in HTML ,and *especially* in forms
> MUST BE QUOTED ! This will really really screw you up if you ever have to
> make an xhtml page (and you'll be back here again). Please please get into
> this practice, it will save you a lot of headaches even short term.
>
> So, change your line to
>
> <input name="link" id="link" type="text" cols="40"
> value="<?=$query_data[4]?>" />
And so you don't come back with problems/questions when $query_data[4] has
double quotes in it, you should do this:
> <input name="link" id="link" type="text" cols="40"
> value="<?=htmlentities($query_data[4],ENT_QUOTES)?>" />
If it hasn't been done to the data already.
---John Holmes...