<?php
ob_start();
if($_SERVER['HTTP_APPVERSION']){
include "./saesiteinfo.php";
}else{
 if(!file_exists("./install/install.lock")){
header('location:./install');
exit;
 }else{
include "./siteinfo.php";
 }
}
//连接数据库
$localhost=mysql_connect($sqlhost,$sqluser,$sqlpass)or die("无法连接服务器");
mysql_select_db($sqldata,$localhost);
if (isset($_COOKIE["SHANIUUSER"]) && isset($_COOKIE["SHANIUPASS"])){
$user=$_COOKIE["SHANIUUSER"];
$pass=$_COOKIE["SHANIUPASS"];
//用户数据
$mysql = mysql_query("SELECT * FROM user WHERE user='$user'");
$sql= mysql_fetch_array($mysql);
//查询QQ个数
$qqnumsql="SELECT COUNT(id) FROM qqlist WHERE myqq='$user' ";
$qqnumqqlist = mysql_fetch_array( mysql_query($qqnumsql) );
$qqnum=$qqnumqqlist[0];

if ($pass!=$sql['pass']){
echo "您还没有登录";
}else{
echo ' 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="css/stylesheets.css" rel="stylesheet" type="text/css" />

';
if ($qqnum>=$sql['peie']+$chushi){
echo "您的挂Q配额已满!请扩充。";
}else{
echo '
<form name="qq" action="./qplus_do.php" method="post">
        <div class="row-fluid">
            <div class="row-form">
                <div class="span12">
                    <input type="text" name="qq" placeholder="QQ账号"/>
                </div>
            </div>
            <div class="row-form">
                <div class="span12">
                    <input type="password" name="pw" placeholder="QQ密码"/>
                </div>            
            </div>
            <div class="row-form">
                <div class="span12">
                    <button class="btn">登录</span></button>
                </div>                
            </div>
        </div>
</form>
';
}

}

}else{
echo "您需要登陆后才能继续操作!";
}
?>