How to get un-escaped text from a form field

This is a discussion on How to get un-escaped text from a form field within the PHP Language forums, part of the PHP Programming Forums category; Hi everybody, I have a php script that gets the text from a form field: <?php include("global....


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-11-2006
a
 
Posts: n/a
Default How to get un-escaped text from a form field

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


Reply With Quote
  #2 (permalink)  
Old 01-11-2006
Pedro Graca
 
Posts: n/a
Default Re: How to get un-escaped text from a form field

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!
Reply With Quote
  #3 (permalink)  
Old 01-11-2006
a
 
Posts: n/a
Default Re: How to get un-escaped text from a form field

That did it. Thanks for the tip!

A

"Pedro Graca" <hexkid@dodgeit.com> wrote in message
news:slrnds8kbp.gck.hexkid@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!



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:16 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0