"Aaron Collins" <aa***@smartwebdevelopment.com> wrote in message
news:f1**************************@posting.google.c om...
Hello,
I have a search string of 3"CC which comes out 3\"CC with
magic_quotes_gpc 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_gpc 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;
Wow, Aaron, you're so close:
"...add or strip the slashes..."
Take that one step further:
$new_string = addslashes($sting);
$old_string = stripslashes($new_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