I'm Coming Back as I\'m - why?

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

  1. #1

    Default I'm Coming Back as I\'m - why?

    When I send text in a textbox to the server and retrieve into a PHP
    var, I'm comes back as I\'m - what is causing this slash and how can I
    get rid of it?

    Thanks...

    Ralph Freshour Guest

  2. Similar Questions and Discussions

    1. Where are all these fonts coming from?
      I'm using InDesign CS2. I know there are at least 14 fonts that live in the system /fonts folder that I can't move, but I have other fonts showing in...
    2. Changes coming with 4.0.4?
      Klaus Read your post again. I believe the word upgrade appears, not update. Glass houses? Fraser
    3. old website keeps coming back!
      We recently overhauled our old website and will continue using Contribute to update our new site. I removed the connection to the old site and...
    4. No data coming back
      Ok to see what was going on with my WYSIWYG control I decided to create a smaller control with just one simple textbox. The idea is to take in the...
    5. Coming Out Of The Shadows
      I saw this topic somewhere on this forum, but can't find it now. The following link was recommended for improving areas in shadow......
  3. #2

    Default Re: I'm Coming Back as I\'m - why?

    Carved in mystic runes upon the very living rock, the last words of Ralph
    Freshour of comp.lang.php make plain:
    > When I send text in a textbox to the server and retrieve into a PHP
    > var, I'm comes back as I\'m - what is causing this slash and how can I
    > get rid of it?
    You have magic_quotes_gpc turned on in your PHP config. Turn it off.

    --
    Alan Little
    Phorm PHP Form Processor
    [url]http://www.phorm.com/[/url]
    Alan Little Guest

  4. #3

    Default Re: I'm Coming Back as I\'m - why?

    I noticed that Message-ID: <Xns941CED51B27C4alanphormcom@216.196.97.132>
    from Alan Little contained the following:
    >> When I send text in a textbox to the server and retrieve into a PHP
    >> var, I'm comes back as I\'m - what is causing this slash and how can I
    >> get rid of it?
    >
    >You have magic_quotes_gpc turned on in your PHP config. Turn it off.
    Actually, don't.

    Use stripslashes($textbox_var)

    --
    Geoff Berrow
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs [url]http://www.ckdog.co.uk/rfdmaker/[/url]
    Geoff Berrow Guest

  5. #4

    Default Re: I'm Coming Back as I\'m - why?

    Geoff Berrow wrote:
    > I noticed that Message-ID: <Xns941CED51B27C4alanphormcom@216.196.97.132>
    > from Alan Little contained the following:
    >
    >>> When I send text in a textbox to the server and retrieve into a PHP
    >>> var, I'm comes back as I\'m - what is causing this slash and how can I
    >>> get rid of it?
    >>
    >>You have magic_quotes_gpc turned on in your PHP config. Turn it off.
    >
    > Actually, don't.
    >
    > Use stripslashes($textbox_var)
    Why? Surely it's better to not convert the input data in the first place
    unless required? I've never understood the reasoning behind it defaulting
    to on.

    --
    Jim Dabell

    Jim Dabell Guest

  6. #5

    Default Re: I'm Coming Back as I\'m - why?

    I noticed that Message-ID: <Msmdnb4IYa7qPQqiRVn-gA@giganews.com> from
    Jim Dabell contained the following:
    >>>You have magic_quotes_gpc turned on in your PHP config. Turn it off.
    >>
    >> Actually, don't.
    >>
    >> Use stripslashes($textbox_var)
    >
    >Why? Surely it's better to not convert the input data in the first place
    >unless required? I've never understood the reasoning behind it defaulting
    >to on.
    The chap is probably a newbie. Best to play safe.

    --
    Geoff Berrow
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs [url]http://www.ckdog.co.uk/rfdmaker/[/url]
    Geoff Berrow Guest

  7. #6

    Default Re: I'm Coming Back as I\'m - why?

    Geoff Berrow <blthecat@ckdog.co.uk> wrote:
    >>>>You have magic_quotes_gpc turned on in your PHP config. Turn it off.
    >>> Actually, don't.
    >>Why?
    > The chap is probably a newbie. Best to play safe.
    Please explain why you think magic_quotes_gpc would increase safety?

    --

    Daniel Tryba

    Daniel Tryba Guest

  8. #7

    Default Re: I'm Coming Back as I\'m - why?

    Daniel Tryba wrote:
    > Geoff Berrow <blthecat@ckdog.co.uk> wrote:
    >
    >>>>>You have magic_quotes_gpc turned on in your PHP config. Turn it off.
    >>>>
    >>>>Actually, don't.
    >>>
    >>>Why?
    >>
    >>The chap is probably a newbie. Best to play safe.
    >
    >
    > Please explain why you think magic_quotes_gpc would increase safety?
    >
    unescaped special characters in a string can be used to send arbitrary
    code to the server. this is dangerous in many ways if exploited
    correctly it can most definitely represent a security breach.

    for example if I know the string is used to run a command line process
    with say something like :

    exec("ls $dir", $dirlist, $error );

    I can pass it a string that will do anything I want. You may think it is
    limited to a "ls" command, but just see what happens if I send it a
    string like this " joe; touch myfile; cat ~/.bash_history; rm
    ~/.bash_history"

    see suddenly I have all sorts of control I shouldn't. The similar things
    can be done with fields going to a database, by sending it a "';" to
    end one SQL command and start sending others...

    --
    /---+----+----+----+----+----+----++----+----+----+----+----+----+---\
    I [email]pham.nuwen3d6@libertydice.org[/email] II No nation was ever ruined by I
    I [url]http://www.libertydice.org[/url] II trade, even seemingly the most I
    I remove "3d6" to e-mail II disadvantageous. - Ben Franklin I
    \---+----+----+----+----+----+----++----+----+----+----+----+----+---/

    Pham Nuwen Guest

  9. #8

    Default Re: I'm Coming Back as I\'m - why?

    Pham Nuwen <pham.nuwen3d6@libertydice.org> wrote:
    >>>The chap is probably a newbie. Best to play safe.
    >> Please explain why you think magic_quotes_gpc would increase safety?
    >>
    >
    > unescaped special characters in a string can be used to send arbitrary
    > code to the server. this is dangerous in many ways if exploited
    > correctly it can most definitely represent a security breach.
    [ls exanple]
    > see suddenly I have all sorts of control I shouldn't. The similar things
    > can be done with fields going to a database, by sending it a "';" to
    > end one SQL command and start sending others...
    You prove the point of disabling magic_quotes_gpc exactly. The ls example
    shows that all kind of characters have to be escaped (like (but propable
    not limited to) ';', '*', '/', '?').

    An other example is the use of textarea's (like the OP(?)), you have to
    html escape the users input (including quotes) when displaying it again
    in a browser.

    IMHO magic_quotes_gpc lulls the user into thinking the data is safe. The
    escaping of characters is very important and what to escape is
    different for all kinds of use, but no magic_*_escape_thingy exists for
    most.

    --

    Daniel Tryba

    Daniel Tryba Guest

  10. #9

    Default Re: I'm Coming Back as I\'m - why?

    Carved in mystic runes upon the very living rock, the last words of Pham
    Nuwen of comp.lang.php make plain:
    > Daniel Tryba wrote:
    >
    > see suddenly I have all sorts of control I shouldn't. The similar
    > things can be done with fields going to a database, by sending it a
    > "';" to end one SQL command and start sending others...
    I've tried that with MySQL (on my own databases, of course!) and it doesn't
    work. I'm only able to send one query at a time.

    --
    Alan Little
    Phorm PHP Form Processor
    [url]http://www.phorm.com/[/url]
    Alan Little 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