【php开源代码栏目提醒】:网学会员在php开源代码频道为大家收集整理了savesj.php提供大家参考,希望对大家有所帮助!
<?php
$name=$_POST[name];
$typeid=$_POST[typeid];
$content=$_POST[content];
$addtime=date("Y-m-j H:i:s");
$bbid=$_POST[bbid];
if(is_dir("./sjxz")==false)
{
mkdir("./sjxz");
}
$link=date("YmjHis");
$path=$link.mt_rand(1000000,9999999).strstr($_FILES["address"]["name"],".");
$address="./sjxz/".$path;
move_uploaded_file($_FILES["address"]["tmp_name"],$address);
$address="./admin/sjxz/".$path;
include_once("../conn/conn.php");
$query=my
sql_query("insert into tb_sjxz(name,typeid,content,addtime,address,bbid) values('$name','$typeid','$content','$addtime','$address','$bbid')",$conn);
echo
mysql_error();
if($query){
echo "<script>alert('升级包添加成功!');history.back();</script>";
}else{
echo "<script>alert('升级包添加失败!');history.back();</script>";
}
?>