Re: Input text issues



I believe php is 'escaping' these characters so they will not be parsed as
code.

see http://us3.php.net/manual/en/function.stripslashes.php

hth
nan

"Pol" <Pol@xxxxxxxxxx> wrote in message
news:1206v631dfmpp29@xxxxxxxxxxxxxxxxxxxxx
Whenever I receive input from an HTML text field or and HTML text area
with " or ' meaning double or singe quotes into a php variable and then
print or echo it back out to the user in html I get these characters
accompanies by a \ . Why is this and how can I get rid of it.


$submitform->body=@$_POST['body']; <<<< there are no \ in the input.

print("body - ".$submitform->body."<br>"); <<<< but here there will be
slashes for all ' or " .

Thanks for any help!


.



Relevant Pages

  • Re: [PHP] Preventing SQL Injection/ Cross Site Scripting
    ... It's a shame that so many PHP installations have them enabled, and a huge disappointment that PHP is actually distributed with this stuff enabled! ... encoding data for output to an HTML document. ... characters into 5, 6, or 7-byte strings, if you already provided the correct character set in the Content-Type HTTP header. ... For anything that gets written to a database or used for a query, I suggest escaping the data using a function specifically designed for that database. ...
    (php.general)
  • Re: [PHP] Preventing SQL Injection/ Cross Site Scripting
    ... It's a shame that so many PHP ... encoding data for output to an HTML document. ... characters into 5, 6, or 7-byte strings, if you already provided the ... anything that gets written to a database or used for a query, ...
    (php.general)
  • Re: refactor + help
    ... I'm was messing around with PHP today and I wrote a tiny app that asks ... If your zipcode is less than 5 characters, ... it asks you too enter a zip code with the proper amount of characters. ... the page is sent to the client. ...
    (comp.lang.php)
  • Re: refactor + help
    ... I'm was messing around with PHP today and I wrote a tiny app that asks ... If your zipcode is less than 5 characters, ... it asks you too enter a zip code with the proper amount of characters. ... the page is sent to the client. ...
    (comp.lang.php)
  • Re: refactor + help
    ... I'm was messing around with PHP today and I wrote a tiny app that asks ... it asks you too enter a zip code with the proper amount of characters. ... I cannot figure out how to have the the 'invalid amount of characters' ... the page is sent to the client. ...
    (comp.lang.php)