这是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...");
}
?>
/*
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...");
}
?>
解决方案 »
- function下面的foreach返回怎么只返回一条信息?
- 非技术问题:很想知道下,有多少人和我是一样不喜欢用那些框架的
- ”\n“的问题
- 一道算法题,$str="dfmkm中国dfdf45d11cvv"; 如何找到出现最多的字符.
- mysql升级 查询时的日期兼容性问题
- 写入文件出错
- 请教一个关于fck上传文件的问题,用过的朋友请进.(100分相送,不够再加)
- [[[[送分贴]]]]大家帮忙看看偶公司网站,提点意见..
- 继续招聘大连地区的PHP开发人员
- PHP中使用HTML帮助ActiveX控件的奇怪问题?大家帮忙看看。
- php如何读取标准输入设备的数据?
- [help] php的http上传文件问题
......上传文件不成功,这是最大的错误