/*** file login.php ***/ session_start(); define('AICN', true); require '../include/init.php'; if (isset($_POST['act']) && $_POST['act'] == 'act_logi') { if (!isset($_POST['username']) or $_POST['passwd'] == '') { echo "请输入帐号密码3秒后重新登陆"; echo "<meta http-equiv='refresh' content='3,url=login.php'/>"; //echo'请输入帐号密码'; //header('Location: login.php'); exit; } $user = new usermodel(); $_POST['username'] = $user->compress_html($_POST['username']); $_POST['passwd'] = $user->compress_html($_POST['passwd']); $u = $_POST['username']; $p = $_POST['passwd']; $row = $user->checkmadin($u, $p); if (!isset($_SESSION['username']) or $_SESSION['username'] == '') { echo "3秒后重新登陆"; echo "<meta http-equiv='refresh' content='3,url=login.php'/>"; exit; } header('Location: index.php'); exit; } ?> <!doctype html> <html lang="en">
/*** file .php if($user->reg($data)) { $msg = '用户注册成功'; echo $msg; } else { $msg = '用户注册失败'; echo $msg; } <?php sleep(2);header('Location: register.php');?> ***/ define('AICN', true); require './include/init.php'; $user = new usermodel(); $_POST['username'] = $user->compress_html($_POST['username']); $_POST['qq'] = $user->compress_html($_POST['qq']); $_POST['phonenumber'] = $user->compress_html($_POST['phonenumber']); $_POST['email'] = $user->compress_emil($_POST['email']); $_POST['passwd'] = $user->compress_html($_POST['passwd']); if (!$user->_validate($_POST)) { // 自动检验 $msg = implode('<br />', $user->getErr()); // echo $msg; include ROOT . 'view/front/msg.html'; exit; } // 检验用户名是否已存在 if ($user->checkuser($_POST['username'])) { $msg = '用户名已存在'; include ROOT . 'view/front/msg.html';