Page 1 of 1

Special Characters in HTML Forms

Posted: Tue Jul 15, 2003 9:00 am
by stovertl1
I have a simple mail form in which I type the following into the mail message:

The "Iron Men" like Harry's dog.

I retrieve the message body with the following statement:

$Body = $_POST[ "frmBody" ];

When I display $Body, I obtain:

The \"Iron Men\" like Harry''s dog.

How can I eliminate the back slashes before the double quote and apostrophe characters? They appear to be inserted by the PHP form parameter parser. I am using PHP Version 4.3.1.

Posted: Tue Jul 15, 2003 9:22 am
by Wayne

Code: Select all

stripslashes($Body);

stripslashes()

Posted: Tue Jul 15, 2003 11:27 am
by stovertl1
Thanks Wayne. The stripslashes() function did exactlye what I wanted. This is the first time I've ever used PHP so I have a lot to learn.

Posted: Tue Jul 15, 2003 1:46 pm
by m3rajk
i suggest getting a php book if you're new. it'll help you learn and you wont need to wait. also try http://www.php.net
they have all the functions etc on there

Posted: Tue Jul 15, 2003 2:44 pm
by redhair
m3rajk wrote:i suggest getting a php book....
See this post about wich book to get :wink: