Re: Repopulating forms
| From: | Gerard L Petersen | Date: | Tue, 05 Aug 2003 14:33:00 +0000 |
| Subject: | Re: Repopulating forms | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-158293@lists.php.net to get a copy of this message | ||
Sweet...
Thank you. Works perfectly.
You all have be most helpful.
Hope this works in Smarty....
Gerard
----- Original Message -----
From: "CPT John W. Holmes" <holmes072000@charter.net>
To: "Gerard L Petersen" <gerard@gamelink.co.za>; "Php-General"
<php-general@lists.php.net>
Sent: Tuesday, August 05, 2003 4:07 PM
Subject: Re: [PHP] Repopulating forms
> From: "Gerard L Petersen" <gerard@gamelink.co.za>
> > My code looks like this.
> >
> > <?PHP
> > $test = "gerard's name is \"gerard\"";
> > echo $test."<br>";
> > echo '<input type="text" name="test2"
> > value="'.$test.'"><br>';
> > ?>
>
> Just like HTML doesn't render newlines, it also doesn't understand using
the
> \ character as an escape character. You are creating this:
>
> <input type="text" name="test2" value="gerard's name is
> "gerard"">
>
> So, HTML takes the first bit between double quotes and ignores the rest as
a
> unknown attribute.
>
> Run htmlentities() on $test before putting it in the INPUT element to
change
> the quotes to HTML entities.
>
> ---John Holmes...
>