日期:2013-05-06 浏览次数:20471 次
0.sql
CREATE TABLE user_log (
log_id int(10) NOT NULL auto_increment,
nicker varchar(20),
password varchar(10) NOT NULL,
log_count int(10),
last_time varchar(20),
last_ip varchar(30),
arc_count int(10),
gender enum('M','W') DEFAULT 'M' NOT NULL,
level int(1),
right varchar(10),
exp_count int(10),
PRIMARY KEY (log_id),
UNIQUE log_id (log_id)
);
CREATE TABLE user_attr (
log_id int(10) NOT NULL,
realname varchar(20),
email varchar(40),
address varchar(50),
birthday varchar(20),
oicq int(8),
last_time varchar(20),
homepage varchar(50),
merriage enum('Y','N') DEFAULT 'N' NOT NULL,
edu_level varchar(8),
edu_school varchar(30),
province varchar(20),
city varchar(20),
postalcode int(6),
fond varchar(8),
present text,
PRIMARY KEY (log_id),
UNIQUE log_id (log_id)
);
CREATE TABLE user_online (
log_id int(10) NOT NULL,
nicker varchar(20),
log_count int(10),
log_time varchar(20),
log_ip varchar(30),
arc_count int(10),
gender enum('M','W') DEFAULT 'M' NOT NULL,
level int(1),
right varchar(10),
exp_count int(10),
PRIMARY KEY (log_id),
UNIQUE log_id (log_id)
);
1.register.php
<?
include "common.inc.php";
function Checknicker($nicker) {
global $USER_LOG_TABLE;
$SQL="SELECT nicker FROM $USER_LOG_TABLE WHERE nicker='$nicker'";
$result=mysql_query($SQL) or die(mysql_error());
$row=mysql_fetch_Array($result);
$nicker=$row[nicker];
return $nicker;
}
function AddUser() {
global $USER_LOG_TABLE;
global $id,$REMOTE_ADDR,$nicker;
global $password, $log_count, $last_time,
$last_ip, $arc_count, $gender, $level, $right,
$exp_count;
$last_time=date("Y:m:d");
$log_count=0;
$last_ip=$REMOTE_ADDR;
$arc_count=0;
$level=9;
$right='NONE';
$exp_count=100;
$SQL="INSERT INTO $USER_LOG_TABLE (
nicker, password,log_count,last_time,last_ip,arc_count,
&n