RE: [PHP] Question: Validation on a text field
| From: | Stuart Felenstein | Date: | Thu, 04 Nov 2004 22:03:02 +0000 |
| Subject: | RE: [PHP] Question: Validation on a text field | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-201230@lists.php.net to get a copy of this message | ||
--- Jay Blanchard
<jay.blanchard@niicommunications.com> wrote:
> [snip]
> May I ask why you are suggesting this function ?
>
> > You can use htmlentities() on the information
> placed
> [/snip]
>
> Because it will convert things like quotes into
> their HTML counterparts
> before you place them into the table.
I'm still a bit fuzzy on how to write it out.
So if field is labelled f5
Then I'm doing a $_SESSION['f5'] = $_POST['MyText'];
then I think it would be
$f5 = htmlentities($f5, ENT_QUOTES);
insert $f5 into database ?
Thanks
Stuart