⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addfile.php

📁 修正了多处BUG
💻 PHP
字号:
<? 


include_once('session.php');
include_once('function.php');
include_once('config.php');
if (islogin($_SESSION['username'],$_SESSION['userpass']))
	$accept=true;
else {
$accept=false;
exit;
}

?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加程序</title>
<link href="css.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#F3F7FC" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<font class="size10"> 
<?
include_once('addclass.php');
$addfile_dir="upload/";
$time=time();
$ftime=date("Y-m-d g:i",$time);
$login_name=$_SESSION['username'];
$addname=strip_tags($_POST['addname']);
$addfile_name=rname($_FILES['addfile']['name']);
$addfile_type=givetype($_FILES['addfile']['name']);
$addfile_size=$_FILES['addfile']['size'];

$addfilesize=$addfile_size/1024;
$addfile_tmp=$_FILES['addfile']['tmp_name'];
$addfile_info=strip_tags($_POST['addarea']);
$addmod=$_POST['addmod'];

$add=new addclass($dbname);
if (isfull($login_name))
{
	$_POST[addmod]=false;
	box("<font color=red >错误 :</font>","你的文件库已满,请删除一部分才能继续添加","addfile.php");
	$errormeg="<font color=red >错误 :</font>你的文件库已满,请删除一部分才能继续添加";
	}


elseif ($addname==""&&$addmod&&$accept)
{
 
	
	$errormeg="<font color=red >错误 </font>: 必须有文件名?";
	require('template/addfileform.php');
	
	}

elseif ($_POST['addmod']&&$accept&&$addname!="")
{  
	
	if ($_POST['share']=="someshare") 
		$text_mod="局部共享";
	elseif ($_POST['share']=="allshare") 
		$text_mod="无限制共享";
	else 
		$text_mod="没有共享";
		
uploadfile($addfile_name,$addfile_size,$addfile_dir,$addfile_tmp);
$worker_job=getjob($_SESSION[username]);
$flag=$add->addsql("worker_file","'$addname','$addfile_name','$login_name','$addfile_type','$addfilesize',$time,'$text_mod','$ftime',null,'$addfile_info','$worker_job','$_POST[dir_id]'");
if ($flag)
{ 
	$errormeg="<font color=red>添加成功</font> 可以<a href=# onclick=\"window.close();return false;\">关闭窗口</a>,或继续添加";
	
	box("<font color=red>添加成功</font> ","添加文件 $addname 成功可以继续添加","addfile.php");
	}
else 
{
	$errormeg="<font color=red>添加失败: </font>文件名重复";
	box("<font color=red>添加失败: </font>","文件名重复","addfile.php");
	}
	}
else require('template/addfileform.php');
?>
</font> 
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -