From: 175384354 at qq dot com Operating system: windows server 2003 PHP version: 5.3.15 Package: *General Issues Bug Type: Bug Bug description:ISAPIæ¹å¼ä½¿ç¨PHP,ä¼å¯¼è´webæå¡å¨å´©æº.
Description: ------------ php post Test script: --------------- <?php setcookie("myup","tgy_cookie_up",time()+3600); ?> <form action="" method="post" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value=""> <input type="file" name="pic" /><br> <input type="file" name="text" /><br> <input type="file" name="doc" /><br> <input type="file" name="pdf" /><br> <input type="submit" value="å¼å§ä¸ä¼ "/> </form> <? $up_info=$_FILES; $upload_dir="upload/"; $typelist=array("image/gif","image/jpeg","image/pjpeg","image/png"); if (!is_dir( $upload_dir)) { if (!mkdir($upload_dir)) die ("upload_files directory doesn't exist and creation failed"); if (!chmod($upload_dir,0755)) die ("change permission to 755 failed."); } $handle=opendir($upload_dir); $filelist = ""; foreach($up_info as $k_name=>$value){ //ç¨foreachå¾ªç¯ å¤çå¤ä¸ªæä»¶çä¸ä¼ //2.夿æä»¶æ¯å¦ä¸ä¼ é误 if($up_info[$k_name]['error']>0){ switch($up_info['error'][$i]){ case 1: $err_info="ä¸ä¼ çæä»¶è¶ è¿äº php.ini ä¸ upload_max_filesize é项éå¶çå¼"; break; case 2: $err_info="ä¸ä¼ æä»¶ç大å°è¶ è¿äº HTML 表åä¸ MAX_FILE_SIZE é项æå®çå¼"; break; case 3: $err_info="æä»¶åªæé¨å被ä¸ä¼ "; break; case 4: $err_info="没ææä»¶è¢«ä¸ä¼ "; break; case 6: $err_info="æ¾ä¸å°ä¸´æ¶æä»¶å¤¹"; break; case 7: $err_info="æä»¶åå ¥å¤±è´¥"; break; default: $err_info="æªç¥çä¸ä¼ é误"; break; } continue($err_info); } $exten_name=pathinfo($up_info[$k_name]['name'],PATHINFO_EXTENSION); do{ $main_name=date('YmHis'.'--'.rand(100,999)); $new_name=$main_name.'.'.$exten_name; }while(file_exists($to_path.'/'.$new_name)); //6.夿æ¯å¦æ¯ä¸ä¼ çæä»¶ï¼å¹¶æ§è¡ä¸ä¼ if(is_uploaded_file($up_info[$k_name]['tmp_name'])){ if(move_uploaded_file($up_info[$k_name]['tmp_name'],$upload_dir.'/'.$new_name)){ echo 'ä¸ä¼ æå!<br>'; }else{ echo 'ä¸ä¼ æä»¶ç§»å¨å¤±è´¥!'; } }else{ echo 'æä»¶ä¸æ¯ä¸ä¼ çæä»¶'; } } //for循ç¯çæ¬å· while ($file = readdir($handle)) { if(!is_dir($file) && !is_link($file)) { $filelist .= "<a href='$upload_dir$file'>".$file."</a>"; if ($DELETABLE) $filelist .= " <a href='?del=$upload_dir$file' title='delete'>x</a>"; $filelist .= "<sub><small><small><font color=grey> ".date("d-m H:i", filemtime($upload_dir.$file))."</font></small></small></sub>"; $filelist .="<br>"; } } echo "COOKIE:".$HTTP_COOKIE_VARS['myup']."<br>"; echo $filelist; ?> Expected result: ---------------- PHPä»PHP5.2.17å°5.3.15 é½åå¨ä¸ä¸ªé®é¢,ä¼å¯¼è´WEBæå¡å¨ç¨åºå´©æºã BUGæè¿°: æå¡å¨æä½ç³»ç»ï¼windows server 2003 æµè§å¨ï¼MS IE 7.0 PHPä½¿ç¨æ¹å¼:isapi æå¼ä¸ä¸ªPOSTä¸ä¼ æä»¶çPHP页é¢å¹¶ä¸ä¼ ä¸ä¸ªæä»¶,å¦æè®©è¿ä¸ªä¸ä¼ 页é¢é²ç½®åå åé以ä¸ï¼å次æäº¤ä¸ä¼ ï¼ä¼å¯¼è´WEBæå¡å¨å´©æºï¼è䏿²¡æä»»ä½æç¤ºã -- Edit bug report at https://bugs.php.net/bug.php?id=62837&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62837&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62837&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62837&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62837&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62837&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62837&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62837&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62837&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62837&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62837&r=support Expected behavior: https://bugs.php.net/fix.php?id=62837&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62837&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62837&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62837&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62837&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=62837&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62837&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62837&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62837&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62837&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62837&r=mysqlcfg