Turning magic quotes off

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Turning magic quotes off

    Hai Friends i need to turn magic quotes gpc off but my host not allows me changes through htacess files
    php vers is 5.3.x can anyone tell me how to turn off it in using the php code i this file ?

    PHP Code:
    <?
    if (function_exists('ini_set'))
    {
    ini_set('display_errors',0); // отключаем показ ошибок
    ini_set('register_globals', 0); // вырубаем глобальные переменные
    ini_set('session.use_cookies', 1); // используем куки для сессий
    ini_set('session.use_trans_sid', 1); // используем url для передачи сессий
    ini_set('arg_separator.output', '&amp;'); // разделитель переменных в url (для соответствия с xml)
    }

    if (ini_get('register_globals')) {
    // принудительно вырубаем глобальные переменные
    $allowed = array('_ENV' => 1, '_GET' => 1, '_POST' => 1, '_COOKIE' => 1, '_FILES' => 1, '_SERVER' => 1, '_REQUEST' => 1, 'GLOBALS' => 1);
    foreach ($GLOBALS as $key => $value) {if (!isset($allowed[$key]))unset($GLOBALS[$key]);}
    }


    list($msec, $sec) = explode(chr(32), microtime()); // время запуска скрипта
    $conf['headtime'] = $sec + $msec;


    define('DCMS_USE_MBSTRING', function_exists('mb_get_info'));
    define('DCMS_USE_ICONV', function_exists('iconv'));
    define('DCMS_USE_FFMPEG', class_exists('ffmpeg_movie'));
    define('DCMS_USE_MCRYPT', function_exists('mcrypt_cbc'));
    define('DCMS_USE_MYSQL', function_exists('mysql_info'));
    define('DCMS_USE_GD', function_exists('gd_info'));
    define('DCMS_SET_TIME_LIMIT', function_exists('set_time_limit'));
    define('DCMS_USE_ERROR_REPORTING', function_exists('error_reporting'));
    define('DCMS_CURL', function_exists('curl_init'));
    define('DCMS_CURL_MULTI', function_exists('curl_multi_init'));
    define('DCMS_TIME', time()); // текущее время
    define('DCMS_TIME_TODAY',mktime(0, 0, 0)); // время на начало суток
    $time=DCMS_TIME;

    if (!DCMS_USE_MYSQL) die('Расширение MySQL недоступно');

    if (DCMS_USE_ERROR_REPORTING)@error_reporting(0); // отключаем показ ошибок
    // Ставим ограничение для выполнения скрипта на 60 сек
    if (DCMS_SET_TIME_LIMIT)@set_time_limit(60);

    if (DCMS_USE_MBSTRING)mb_internal_encoding('UTF-8');
    if (DCMS_USE_ICONV)iconv_set_encoding('internal_encoding', 'UTF-8');


    $phpvervion=explode('.', phpversion());
    $conf['phpversion']=$phpvervion[0];

    $upload_max_filesize=ini_get('upload_max_filesize');
    if (preg_match('#([0-9]*)([a-z]*)#i',$upload_max_filesize,$varrs))
    {
    if ($varrs[2]=='M')$upload_max_filesize=$varrs[1]*1048576;
    elseif ($varrs[2]=='K')$upload_max_filesize=$varrs[1]*1024;
    elseif ($varrs[2]=='G')$upload_max_filesize=$varrs[1]*1024*1048576;
    }

    ?>
    ComputerForumz - Latest Tech News


    Mobbest.tk-Free Mobile Downloads

    #2
    PHP Code:
    ini_set('magic_quotes_gpc''0'); 

    Comment


      #3
      Originally posted by something else View Post
      PHP Code:
      ini_set('magic_quotes_gpc''0'); 
      I tried i before but not worked eve i tried those
      php function that are diff
      like ini set))){
      codes
      }
      but nuffin happend this is my website WAP4TALK.CO.CC - Look has gone worst it works well on pc xamp plz help me
      ComputerForumz - Latest Tech News


      Mobbest.tk-Free Mobile Downloads

      Comment


        #4
        U want to remove backslashes from displaying? If so u can use this.
        PHP Code:
        if (get_magic_quotes_gpc()) $string stripslashes($string); 
        <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

        Comment


          #5
          No arngage bro u didnt got me my site is made from dcms bcaus of magic quotes my site is not working n showing displaying error ony words are showing like if css i not done look at my site u will understand i want to fully disable those but i cant do with php.ini or htacess so plz help me how to close this via script
          ComputerForumz - Latest Tech News


          Mobbest.tk-Free Mobile Downloads

          Comment


            #6
            arnage. But if it can't solve that problem via php.ini and htaccess than its not problem due to get_magic_quotes_gpc().

            This should be link to css file but it shows internal server error.
            Code:
            http://wap4talk.co.cc/style/themes/smarty_web/style.css
            Post the content of your htacces file and if is there error_log.
            Last edited by arnage; 23.10.11, 13:14.
            <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

            Comment


              #7
              PHP Code:
              # ограничения на выгрузку файлов
              # php_value upload_max_filesize 100M
              # php_value post_max_size 100M


              ####################################################

              # отключаем показ ошибок
              php_value display_errors 0
              # так безопаснее
              php_value register_globals 0
              # убираем экранирование кавычек
              php_value magic_quotes_gpc 0
              # дописываем сессию к URL
              php_value session.use_trans_sid 1
              php_value session
              .cookie_lifetime 0

              # решение проблем с кодировкой
              php_value default_charset UTF-8
              ####################################################


              DirectoryIndex index.php
              # Отключаем листинг директорий при отсутствии index.php
              Options -Indexes

              # задаем соответствие mime типов расширению
              AddType text/vnd.wap.wml;charset=utf-.wml
              AddType application
              /vnd.sonyericsson.mms-template tpl
              AddType application
              /vnd.wap.wmlc .wmlc
              AddType text
              /vnd.wap.wmlscript .wmls
              AddType application
              /vnd.wap.wmlscriptc .wmlsc
              AddType image
              /vnd.wap.wbmp .wbmp
              AddType application
              /vnd.eri.thm .thm
              AddType application
              /vnd.mophun.application .mpn
              AddType application
              /vnd.mophun.certificate .mpc
              AddType text
              /vnd.sun.j2me.app-descriptor .jad
              Addtype text
              /x-vmel .mel
              Addtype audio
              /imelody .imy
              AddType application
              /vnd.smaf .mmf
              Addtype text
              /x-vmel .emy
              AddType audio
              /amr .amr
              AddType audio
              /x-wav .wav
              AddType application
              /x-tar .hid
              Addtype image
              /jpeg .jpg
              Addtype image
              /jpeg .jpeg
              Addtype image
              /gif .gif
              Addtype image
              /png .png
              Addtype image
              /bmp .bmp
              Addtype text
              /x-imelody .imy
              Addtype text
              /x-emelody .emy
              Addtype text
              /x-vcard .vcf
              Addtype text
              /x-vcalendar .vcs
              Addtype text
              /calendar .ics
              Addtype application
              /smil .smil
              Addtype application
              /smil .smi
              Addtype application
              /java-archive .jar
              Addtype application
              /vnd.symbian.install .sis
              Addtype audio
              /wav .wav
              Addtype audio
              /midi .midi
              Addtype audio
              /midi .mid
              Addtype audio
              /rmf .rmf
              Addtype application
              /vnd.wap.mms-message .mms
              AddType video
              /flv .flv
              AddType video
              /mp4 .mp4
              Addtype video
              /3gpp .3gp
              Addtype application
              /zip .zip
              Addtype audio
              /mpeg .mp3


              # переопределяем страницы ошибок
              ErrorDocument 400 /err.php?err=400
              ErrorDocument 401 
              /err.php?err=401
              ErrorDocument 402 
              /err.php?err=402
              ErrorDocument 403 
              /err.php?err=403
              ErrorDocument 404 
              /err.php?err=404
              ErrorDocument 500 
              /err.php?err=500
              ErrorDocument 502 
              /err.php?err=502 
              i have comented those php values bcaus my site goes 500 error if do dat n its working on xamp where magic quotes are turned offf i think i have to buy a paid host
              ComputerForumz - Latest Tech News


              Mobbest.tk-Free Mobile Downloads

              Comment


                #8
                rajveer bro simply delete .htacess file from theme directory and your css will work fine ;)
                Free Web Hosting @HostersPoint.com
                php Hosting with Web Builder

                Buy - Sell ADs
                ADMOLA ADs Network
                Monetize Your Site Traffic

                Comment


                  #9
                  ***ENGLISH on forums***
                  Last edited by metulj; 24.10.11, 10:00.
                  ComputerForumz - Latest Tech News


                  Mobbest.tk-Free Mobile Downloads

                  Comment


                    #10
                    bro look again in /style directory folder hope you will find
                    Free Web Hosting @HostersPoint.com
                    php Hosting with Web Builder

                    Buy - Sell ADs
                    ADMOLA ADs Network
                    Monetize Your Site Traffic

                    Comment


                      #11
                      Yep irffi bro mene delete kar dia n site working fully thnx all for helping
                      ComputerForumz - Latest Tech News


                      Mobbest.tk-Free Mobile Downloads

                      Comment


                        #12
                        my plxr bro :x
                        Free Web Hosting @HostersPoint.com
                        php Hosting with Web Builder

                        Buy - Sell ADs
                        ADMOLA ADs Network
                        Monetize Your Site Traffic

                        Comment

                        Working...
                        X