Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    I love PHP because its always simpler than you might expect ...
    PHP Code:
    <?php
    if(!function_exists('glob')){
        function 
    glob($pattern){
           
    //write your own glob routine here//
        
    }
    }
    ?>
    does not cause the errors you may at first expect!

    the recursive cleaner I use... (GPC_ON is set in config if the server has magic_quotes runtime or GPC turned on)
    PHP Code:
    <?php
    function clean(&$arr){
        foreach(
    $arr as $k=>$v){
            if(!
    is_array($v)){
                            if(
    defined('GPC_ON')){
                                
    $arr[$k]=stripslashes($v);
                             }
                
    $arr[$k]=mysql_real_escape_string($v);
            }else{
                
    clean($arr[$k]);
            }
        }
    }
    clean($_POST);
    ?>
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  2. #17
    Senior Coder
    Join Date
    Apr 2005
    Location
    Colorado, United States
    Posts
    1,208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by firepages
    the recursive cleaner I use... (GPC_ON is set in config if the server has magic_quotes runtime or GPC turned on)
    This a nice, simple function. I like it...much more simple than my wrapper. I never knew there was a constant I could use to detect runtime or gpc either.
    Last edited by Velox Letum; 01-05-2006 at 12:22 AM.
    "$question = ( to() ) ? be() : ~be();"

  3. #18
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    Quote Originally Posted by Velox Letum
    I never knew there was a constant I could use to detect runtime or gpc either.
    sorry I was not clear AFAIK there isn't , its one I set myself in a global config file with calls to get_magic_quotes_runtime() and get_magic_quotes_gpc()
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  4. #19
    Senior Coder
    Join Date
    Apr 2005
    Location
    Colorado, United States
    Posts
    1,208
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by firepages
    sorry I was not clear AFAIK there isn't , its one I set myself in a global config file with calls to get_magic_quotes_runtime() and get_magic_quotes_gpc()
    Ahh okay. Smart, that. =)
    "$question = ( to() ) ? be() : ~be();"


 
Page 2 of 2 FirstFirst 12

Posting Permissions

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