Re: Problem WITH AddSlashes
| From: | Dean Hall | Date: | Mon, 21 Aug 2000 16:22:32 +0000 |
| Subject: | Re: Problem WITH AddSlashes | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-2230@lists.php.net to get a copy of this message | ||
On Mon, 21 Aug 2000, Enrico Comini wrote:
> With php If I have to pass a field with a form I use
>
> ECHO "<form method=post action=\"checkout.php3\">
> <input type=hidden name=\"note\"
> value=\"".AddSlashes($note)."\">
> <input type=submit value=\"Press to reinsert\">";
>
> Is impossible to pass a string like $note if contains ' " or \.
First, I would do this:
// some PHP here
?>
<form method="POST" action="checkout.php3">
<input type="hidden" name="note"
value="<?=AddSlashes($note)?>">
<input type="submit" value="Press to reinsert">
<?
// some PHP here
Then, you have to think how AddSlashes($note) shoes up in the HTML. If all
quotes are escaped properly, it's completely fine. All you should be
worried about is how to do it syntactically correct in PHP and how to make
it show up correctly in HTML.
Dean.