magic quote question

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

    magic quote question

    Hello,

    I have a search string of 3"CC which comes out 3\"CC with
    magic_quotes_gp c set to on. I'm having a difficult time passing the
    search string along the url or in a cookie. I've read on php.net of
    other programmers who have written a function to add or strip the
    slashes regardless of whether magic_quotes_gp c is set to on or not.
    Can someone please give some suggestions or a good resource where I
    can learn more about how to do this?

    Thanks so much for your help!!

    Aaron;
  • Zac Hester

    #2
    Re: magic quote question

    "Aaron Collins" <aaron@smartweb development.com > wrote in message
    news:f1ea5874.0 307171303.472d0 50f@posting.goo gle.com...[color=blue]
    > Hello,
    >
    > I have a search string of 3"CC which comes out 3\"CC with
    > magic_quotes_gp c set to on. I'm having a difficult time passing the
    > search string along the url or in a cookie. I've read on php.net of
    > other programmers who have written a function to add or strip the
    > slashes regardless of whether magic_quotes_gp c is set to on or not.
    > Can someone please give some suggestions or a good resource where I
    > can learn more about how to do this?
    >
    > Thanks so much for your help!!
    >
    > Aaron;[/color]

    Wow, Aaron, you're so close:

    "...add or strip the slashes..."

    Take that one step further:

    $new_string = addslashes($sti ng);

    $old_string = stripslashes($n ew_string);

    If you did a search on php.net, this should have turned up. Also, you
    really need to look in the PHP manual (download it as PDF or view it online)
    and read everything there is about strings. It probably would have saved
    you a lot of time. Also, if you want strange characters in Cookies and
    URLs, lookup the urlencode() function. It does it all automatically.

    HTH,
    Zac


    Comment

    Working...