Input text issues

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pol

    Input text issues

    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 - ".$submitfo rm->body."<br>") ; <<<< but here there will
    be slashes for all ' or " .

    Thanks for any help!
  • Nancy

    #2
    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@nospam.com > wrote in message
    news:1206v631df mpp29@news.supe rnews.com...[color=blue]
    > 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 - ".$submitfo rm->body."<br>") ; <<<< but here there will be
    > slashes for all ' or " .
    >
    > Thanks for any help![/color]


    Comment

    • Nancy

      #3
      Re: Input text issues

      Andy Hassall has a better answer under the previous post "Weird: Slashes
      getting added"
      "Nancy" <no@email.due.t o.spam.com> wrote in message
      news:AVLMf.4532 $S25.1853@newsr ead1.news.atl.e arthlink.net...[color=blue]
      >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@nospam.com > wrote in message
      > news:1206v631df mpp29@news.supe rnews.com...[color=green]
      >> 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 - ".$submitfo rm->body."<br>") ; <<<< but here there will be
      >> slashes for all ' or " .
      >>
      >> Thanks for any help![/color]
      >
      >[/color]


      Comment

      • Carl

        #4
        Re: Input text issues

        Pol wrote:[color=blue]
        > 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 - ".$submitfo rm->body."<br>") ; <<<< but here there will
        > be slashes for all ' or " .
        >
        > Thanks for any help![/color]

        Pol,

        I believe this was asked and answered in this same ng less than an hour ago.

        see


        Carl.

        Comment

        • Mitul

          #5
          Re: Input text issues

          hi friend,

          Please try to user stripeslashes this will remove slashes and gives you
          data as u had enterd.

          Comment

          Working...