<?php
header("content-type:text/html;charset=utf-8");
date_default_timezone_set("PRC");
error_reporting(0);
require "../myadmin/sql.php";
if(isset($_POST['user'])){$username1=$_POST['user'];}else{exit;}
if(isset($_POST['password'])){$password=$_POST['password'];}else{exit;}
if(isset($_POST['queren'])){$queren=$_POST['queren'];}else{exit;}
if(isset($_POST['qq'])){$qq=$_POST['qq'];}else{exit;}
if(isset($_POST['zhifubao'])){$zhifubao=$_POST['zhifubao'];}else{exit;}
if(isset($_POST['zhifubaoxingming'])){$xingming=$_POST['zhifubaoxingming'];}else{exit;}
if(isset($_POST['wenti'])){$wenti=$_POST['wenti'];}else{exit;}
if(isset($_POST['daan'])){$daan=$_POST['daan'];}else{exit;}
$sql="insert into user(username,password,qq,zhifubao,xingming,wenti,daan,time) values('{$username1}','{$password}','{$qq}','{$zhifubao}','{$xingming}','{$wenti}','{$daan}',".time().")";
if(mysql_query($sql)){
    $sql="select * from user where username='{$username1}'";
    $cha_row=mysql_fetch_assoc(mysql_query($sql));
    $tot_insert_sql="insert into tb_tot(username,jiage,uid,time) values('{$cha_row['username']}','0',{$cha_row['id']},".time().")";
    $tot_insert_rst=mysql_query($tot_insert_sql);
    echo "<script>alert('注册成功请登录');location='../index.php';</script>";
}
?>