From: "Gerard L Petersen" <[EMAIL PROTECTED]>
> 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...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to