#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    252
    Rep Power
    0

    Disabling magic quotes fails all the times with htaccess


    hello dear folks i am allmost lost here

    i want to disable magic quotes

    http://php.net/manual/en/security.magicquotes.php

    in order to switch Magic Quotes to off i tried both ways - both failed.... and gave back this text

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, at the site.... and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.

    i tried it this way - by naming the file .htaccess


    Code:
    <?php
    
    
    php_flag magic_quotes_gpc off
    
    
    
    ?>
    and also that way


    Code:
    <?php
    if (get_magic_quotes_gpc()) {
        $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
        while (list($key, $val) = each($process)) {
            foreach ($val as $k => $v) {
                unset($process[$key][$k]);
                if (is_array($v)) {
                    $process[$key][stripslashes($k)] = $v;
                    $process[] = &$process[$key][stripslashes($k)];
                } else {
                    $process[$key][stripslashes($k)] = stripslashes($v);
                }
            }
        }
        unset($process);
    }
    ?>


    what can i do now
    hmm i can talk to the serveradmin - but is nt it possible to do it at the www-side - the webroot!?

    love to hear from you
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,698
    Rep Power
    6351
    .htaccess files are not PHP files, <?php tags are incorrect.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  4. #3
  5. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,301
    Rep Power
    7170
    Putting php_flag inside .htaccess will only work if PHP is an Apache module (and you remove the <?php ?> tags as ManiacDan said).

    You should contact the server administrator for assistance. It may be possible for you to make the change without the server administrator, but the way that you make the change depends on how the server is configured. On some systems where PHP is not an Apache module, they may allow you to create your own php.ini files, but the location and name of the ini files varies depending on how the server is configured.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo