<?php require 'func/base.php'; require 'func/sql.class.php'; $sqlhelper = new func\SqlHelper(); $uname = $sqlhelper->getSql($_POST['username']); $pwd = $sqlhelper->getSql($_POST['pwd']); $email = $sqlhelper->getSql($_POST['email']); $age = $sqlhelper->getSql($_POST['age']); $role = $sqlhelper->getSql($_POST['role']); $sql = "insert into users(name,pwd,email,tel,age,role) values('{$uname}','{$pwd}','{$email}','{$tel}',{$age},{$role})"; if ($sqlhelper->update($sql)) { $sql = "select id,name from users where name = '{$uname}'"; $ret = $sqlhelper->query($sql); if ($role == 1) { $_SESSION[SESSION_UER_ID] = $ret[0]['id']; $_SESSION[SESSION_UER_NAME] = $ret[0]['name']; header("Location: index.php"); } else { header("Location: index.php"); } } else { error_log($sqlhelper->sqlerror); header("Location: regedit.php"); }