你只帖了表单,没有帖真正上传的源程序.PS:
PHP的http上传容易出错的地方:
1.服务器上传的文件夹的属性应为"777"(Linux);
2.文件大小不能超过"MAX_FILE_SIZE";

解决方案 »

  1.   

    这是php内容[我加上注释了] 
    /* 
    PHP 源程序。 
    自定函数: 
    get_param(); 获得HTTP_POST_VARS 和 HTTP_GET_VARS & REQUEST_STR.. 
    format_tags();==htmlspecialchar() 
    error(); 
    */ 
    <? 
    if(get_param('action')=="add_products"){ $s_item=format_tags(get_param("item")); 
    $s_pnum=format_tags(get_param("p_num")); 
    $s_pdes=format_tags(get_param("p_des")); 
    $s_pfun=format_tags(get_param("p_fun")); if($s_pnum=="") error("ERROR:\\nProduct Number NULL!"); 
    if($s_pdes=="") error("ERROR:\\nProduct Description NULL!"); if(!is_uploaded_file($_FILES['img']['tmp_name'][0])) error("ERROR:\\nUpload Product Small Photo Failed!"); if(!is_uploaded_file($_FILES['img']['tmp_name'][1])) error("ERROR:\\nUpload Product Large Photo Failed!"); $ext_name=substr($_FILES['img']['tmp_name'][0],-4,4); 
    $save_imgs=time().random('6','1').strtolower($ext_name); 
    if($ext_name!=".jpg" || $ext_name!=".gif" || $ext_name!=".JPG" || $ext_name!=".GIF" ) error("ERROR:\\nUpload File Type UNLL!\\nOnly support JPG/GIF"); 
    Move_uploaded_file($_FILES['img']['tmp_name'][0], $pdt_dir.$save_imgs); $ext_name=substr($_FILES[img][tmp_name][1],-4,4); 
    $save_imgb=time().random('6','1').strtolower($ext_name); 
    if($ext_name!=".jpg" || $ext_name!=".gif" || $ext_name!=".JPG" || $ext_name!=".GIF" ) error("ERROR:\\nUpload File Type UNLL! Only support JPG/GIF"); 
    Move_uploaded_file($_FILES[img][tmp_name][1], $pdt_dir.$save_imgb); $date="20".date('y-m-d h:i:s'); 
    $db->query("Insert into products values ('','".get_session('s_user')."','$s_item','$s_pnum','$save_imgs','$save_imgb','$s_pdes','$s_pfun','$date')"); 
    error("Add Product Successful,Please Continue..."); 

    ?>
      

  2.   

    真是的,一个问题等了3天! 还程序员大本营呢! Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!Shit!