<?php
if (  ! defined( 'MOD' ))
{
	die("access die");
}
if ( $_POST['up'] == 1 ){
	checkAdminReferer();
	$name = trim( $_POST['name'] );
	$serverpath = trim( $_POST['serverpath'] );
	if(substr($serverpath, -1) != '/') $serverpath = $serverpath . '/';
	$chanid = intval( $_POST['channelid'] );
	$is_lock = intval( $_POST['is_lock'] );
	$displayorder = intval( $_POST['displayorder'] );

	if (  ! $name ||  ! $serverpath )
	{
		qbase::showmsg('服务器名称与地址必须题写');
	}

	qdb::Query("insert into `".TABLEPRE."downserver` (`channelid`,`name`,`serverpath`,`is_lock`,`displayorder`) values('$chanid','".$name."','".$serverpath."','$is_lock','$displayorder')" );
	servercache();
	qbase::showmsg( '服务器信添加完毕', 'default', "module.php?mod={$mod}&action=server&channelid={$channelid}" );
}

?>
