470,855 Members | 1,330 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,855 developers. It's quick & easy.

How to get un-escaped text from a form field

a
Hi everybody,

I have a php script that gets the text from a form field:

<?php

include("global.inc.php");

pt_register( 'POST', 'test1');
echo $test1;

?>

The text comes back fine, just some characters (', " and \) are now escaped
(\', \" and \\). The problem is that I need the he text to be exactly as it
was entered by the user. I could process the text myself, and replace the
escaped characters, but I'd like first to understand why this is happening
and if there is a way to disable this behavior and get the unmodified text
directly.

Thanks,

A
Jan 10 '06 #1
2 1566
a wrote:
I have a php script that gets the text from a form field: <snip> The text comes back fine, just some characters (', " and \) are now escaped
(\', \" and \\). [...] I'd like first to understand why this is happening
and if there is a way to disable this behavior


magic_quotes_gpc

see http://www.php.net/get_magic_quotes_gpc

--
Mail to my "From:" address is readable by all at http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
may bypass my spam filter. If it does, I may reply from another address!
Jan 11 '06 #2
a
That did it. Thanks for the tip!

A

"Pedro Graca" <he****@dodgeit.com> wrote in message
news:sl*******************@ID-203069.user.individual.net...
a wrote:
I have a php script that gets the text from a form field:

<snip>
The text comes back fine, just some characters (', " and \) are now
escaped
(\', \" and \\).

[...]
I'd like first to understand why this is happening
and if there is a way to disable this behavior


magic_quotes_gpc

see http://www.php.net/get_magic_quotes_gpc

--
Mail to my "From:" address is readable by all at http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>)
may bypass my spam filter. If it does, I may reply from another address!

Jan 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Mauro | last post: by
5 posts views Thread by Chris | last post: by
3 posts views Thread by Jorge Gallardo | last post: by
3 posts views Thread by nano9 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.