<?php 
	/**/
	 $conf = include 'ong/config.php';
	 $mysql_server_name=$conf['write']['host']; //改成自己的mysql数据库服务器

	$mysql_username=$conf['write']['user']; //改成自己的mysql数据库用户名
	 
	$mysql_password=$conf['write']['pass']; //改成自己的mysql数据库密码
	 
	$mysql_database=$conf['write']['name']; //改成自己的mysql数据库名


	$mysqli=new mysqli($mysql_server_name,$mysql_username,$mysql_password,$mysql_database);
	if(mysqli_connect_errno()){
	    echo "连接数据库失败：".mysqli_connect_error();
	    $mysqli=null;
	    exit;
	}
	//执行插入和删除，更新语句
	//$sql="insert into students (name,sex,age,tel) values('hello','man','25','13525654699')";
	//$sql="delete from students where id>5";
	$sql="select * from ay_shezhi where id=4";
	//执行sql语句
	$result=$mysqli->query($sql);
	$data = $result->fetch_all(MYSQLI_ASSOC);
	$yuming = $data[0]['data'] ;


	

	$gg = $_SERVER['QUERY_STRING'];

	$gg = str_replace('shuju=', '', $gg);
	$sss = explode('?', $gg);

	$hhh = $sss[1];
	
	$rr = explode('&', $hhh);

	$num = count($rr);
	if ($num>1) {
		
		$tiao = $yuming.'?'.$rr[0].'&'.$rr[1];


		$uu1 = explode('=', $rr[0]);
		$uu2 = explode('=', $rr[1]);

		$_SESSION['tuid'] = (float)$uu1[1];
		$_SESSION['adminid'] = (float)$uu2[1];



	}else{

		$tiao = $yuming.'?'.$rr[0];

		$uu1 = explode('=', $rr[0]);
		$_SESSION['adminid'] = (float)$uu1[1];

	}
	header("Location: $tiao");
//确保重定向后，后续代码不会被执行 
	exit();
?>