text received via POST

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default text received via POST

    Hi All


    I am sending a textarea field via POST to a form.

    What happens is that all occurences of ' " and & in the text received via
    $_POST[] in that form are now preceded by a \

    What is causing this and how can I avoid it ?

    I would like to receive the text as seen in the textarea field.

    I am using php 4.2.1

    Thanks in advance
    Heinz



    Heinz Guest

  2. Similar Questions and Discussions

    1. Text to post to page
      I am looking for a way to allow a user to change a message on a webpage. It would work like this. the user goes to a page with a text area and...
    2. LWP POST - source page received istead of data
      Hello Group, I am new to perl world and especially html. I'm trying to get data from my http server. But instead of expected data I get source...
    3. Lost Post: Scroll text document with photo
      I have a pdf document (text with a photo) that was made in word on a mac. I want the user to be able to view the document and scroll it in the...
    4. Post Script - Hylafax - Text File - perl
      I want to write a script that takes piped input and then fills out a purchase order form that can then be sent to Hylafax as a postscript file. ...
    5. Rich Text Editor with POST?
      I just downloaded the cross-browser rich text editor from Kevin Roth. http://www.kevinroth.com/rte/demo.htm Sample fo the html code: <!--...
  3. #2

    Default Re: text received via POST

    Heinz wrote:
    >
    > Hi All
    >
    > I am sending a textarea field via POST to a form.
    >
    > What happens is that all occurences of ' " and & in the text received via
    > $_POST[] in that form are now preceded by a \
    >
    > What is causing this and how can I avoid it ?
    >
    > I would like to receive the text as seen in the textarea field.
    >
    > I am using php 4.2.1
    >
    > Thanks in advance
    > Heinz
    Try stripslashes().

    Regards,
    Shawn
    --
    Shawn Wilson
    [email]shawn@glassgiant.com[/email]
    [url]http://www.glassgiant.com[/url]
    Shawn Wilson Guest

  4. #3

    Default Re: text received via POST

    Heinz wrote:
    > Hi All
    >
    >
    > I am sending a textarea field via POST to a form.
    >
    > What happens is that all occurences of ' " and & in the text received via
    > $_POST[] in that form are now preceded by a \
    >
    > What is causing this and how can I avoid it ?
    >
    > I would like to receive the text as seen in the textarea field.
    >
    > I am using php 4.2.1
    >
    > Thanks in advance
    > Heinz
    $plaintext = stripslashes($text);

    They're being added automatically by your php settings to protect you
    from SQL insertion attacks.

    Kevin Thorpe Guest

  5. #4

    Default Re: text received via POST

    Kevin Thorpe <kevin@pricetrak.com> writes:
    > > I am sending a textarea field via POST to a form.
    > >
    > > What happens is that all occurences of ' " and & in the text received via
    > > $_POST[] in that form are now preceded by a \
    > >
    > > What is causing this and how can I avoid it ?
    > >
    > > I would like to receive the text as seen in the textarea field.
    > >
    > > I am using php 4.2.1
    >
    > $plaintext = stripslashes($text);
    >
    > They're being added automatically by your php settings to protect you
    > from SQL insertion attacks.
    ....specifically, by the setting of magic_quotes_gpc, which you can check
    by calling get_magic_quotes_gpc(). It's a good idea to make this
    check before calling addslashes() or stripslashes() on form data
    to find out if altering the data is necessary. If you neglect to
    make this check, then the code will probably misbehave if the setting
    of magic_quotes_gpc is ever changed.

    --
    Michael Fuhr
    [url]http://www.fuhr.org/~mfuhr/[/url]
    Michael Fuhr Guest

  6. #5

    Default Re: text received via POST


    "Heinz" <lullundlall@yahoo.com> wrote in message
    news:bpfu9b$1nhcig$1@ID-25174.news.uni-berlin.de...
    > Hi All
    >
    >
    > I am sending a textarea field via POST to a form.
    >
    > What happens is that all occurences of ' " and & in the text received via
    > $_POST[] in that form are now preceded by a \
    >
    > What is causing this and how can I avoid it ?
    >
    > I would like to receive the text as seen in the textarea field.
    >
    > I am using php 4.2.1
    >
    > Thanks in advance
    > Heinz
    >
    >
    >
    Thanks to ALL of you for helping me here.
    I use now :

    if (get_magic_quotes_gpc())
    $text=stripslashes($text);

    and it works :-)

    Cheers
    Heinz





    Heinz Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139