/// BANGBOO BLOG ///

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

August 11, 2006

Struggling with PHP

///// フォーム送信でバックスラッシュが割り込む /////
magic_quotes_gpcがON設藹??となっていると、フォームから藹??け藹??った文字の中縺?\(バックスラッシュ・??、"(ダブルクォーテーショ繝?)、'(シングルクォーテーショ繝?)があった際、その藹??ろに自動で「\」をつけエスケープ処理を行います。SQL injection 対軆??でもあるのですが、SJIS の文字コードの場合、パソコンの「ソ」のコードは「0x83 0x5c」なので、「パソコン」→「パ繧?\コン」となり、上手く表示ができな縺?なります。

PHP.ini  - magic_quotes_gpc を OFF
htaccess - php_flag magic_quotes_gpc off
Code -   if (get_magic_quotes_gpc()) { $str = stripslashes($str);  }


///// サイズが大きいファイルをアップロードできない /////
/etc/httpd/conf.d/php.conf 内の以下の個所を変更する。
#
# Cause the PHP interpreter handle files with a .php extension.
#
<Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
    LimitRequestBody 524288
</Files>


///// メモリ臀??足エラ繝? /////
/etc/php.ini 内の以下の個所を変更する。
;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;
max_execution_time = 30 ; Maximum execution time of each script, in seconds
max_input_time = 60     ; Maximum amount of time each script may spend parsing...
memory_limit = 8M       ; Maximum amount of memory a script may consume (8MB)

twitter
Hatena
Google Buzz
newsing
Yahoo!
Buzzurl
Technorati
del.icio.us
Choix
Iza!
Livedoor Clip
Facebook
Evernote
 

Posted by funa : 05:13 PM | Web | Comment (0) | Trackback (0)