Results 1 to 4 of 4
  1. #1
    Join Date
    May 2007
    Location
    Nebo, NC, USA
    Posts
    2,517
    Tokens
    0

    Latest Awards:

    Default [PHP] CLEAN FUNCTION

    Could someone provide me a function that will clean through posted text. I will add it to my class.

  2. #2
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    PHP Code:
    class misc
    {

        function 
    clean($var)
        {
        
            
    $var htmlspecialchars$varENT_QUOTES );

            if( 
    get_magic_quotes_gpc(   ) ) {
        
                
    $var stripslashes$var );
                        
            }
                    
            
    $var str_replace"\""""$var );
            
    $var htmlentities$var );
            
    $var mysql_real_escape_string$var );
            
            return 
    $var;
        
        }

    Don't know why I posted it in a class...but there you go.

  3. #3
    Join Date
    May 2005
    Location
    San Francisco, CA
    Posts
    7,160
    Tokens
    2,331

    Latest Awards:

    Default

    Sorry, internet messed up and I didn't think the post was made -.-
    Last edited by Invent; 02-10-2007 at 12:12 AM.

  4. #4
    Join Date
    May 2007
    Location
    Nebo, NC, USA
    Posts
    2,517
    Tokens
    0

    Latest Awards:

    Default

    It was

    Thanks mate +REP

Posting Permissions

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