SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 29 of 29
  1. #26
    gimme the uuuuuuuuuuu duuudie's Avatar
    Join Date
    Feb 2004
    Location
    Switzerland
    Posts
    2,253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by frankiehots
    duuudie, I am a dummy. I should have tried your "strip_magic_quotes" function yesterday. It did both things I was trying to do- it stripped the magic quotes slashes and if the user actually entered backslashes it preserved those. Thanks duuudie.
    No prob!

    I am glad you solved your problem

  2. #27
    SitePoint Addict frankiehots's Avatar
    Join Date
    Jan 2002
    Location
    U.S.A. *Blue State*
    Posts
    289
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by duuudie
    yes it's a recursive function.
    duuudie, one more question. Your suggestion worked great but now I am trying to fully understand it. Mainly the part where you use recursion. Why is it necessary to to use that approach?

  3. #28
    Umm. PHP Guru....Naaaah jaswinder_rana's Avatar
    Join Date
    Jul 2004
    Location
    canada
    Posts
    3,193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    to strip slashes from array elements. its detecting if its array then take that element and pass it to function again till there are no more arrays and then strip its slashes (as far as i know you cant directly strip slashes from array). so this function would work like a charm on arays too same like a string.

    at least i think so

  4. #29
    gimme the uuuuuuuuuuu duuudie's Avatar
    Join Date
    Feb 2004
    Location
    Switzerland
    Posts
    2,253
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also one important thing to note is that we apply the function only if magic_quotes_gpc() is on, using the get_magic_quotes_gpc() function.

    It returns 0 if mgqu is off, 1 if on.

    If it returns something (ie 1) we apply the recursive function to the whole array of the superglobals $_GET, $_POST, $_COOKIES

    that's it.

    Don't hesitate to ask if there is something else that you would like to understand


Bookmarks

Posting Permissions

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