日期:2014-05-17 浏览次数:20450 次
<?php
error_reporting(0);
session_start();
require('../libs/Smarty.class.php');
$smarty = new Smarty;
//$smarty->force_compile = true;
$smarty->debugging = false;
$smarty->caching = false;
$smarty->cache_lifetime = 120;
if($_POST['ok'].value==1)
{
$username=$_POST['username'];
$userpwd=$_POST['userpwd'];
$query=mysql_query("INSERT INTO user (user,pwd) values
('$username','$userpwd')")or die(mysql_error());
if($query)
{
$response="<script>alert('注册成功');</script>
<meta http-equiv=refresh content='0; url=login.php'>";
}
else
{
$response="<script>alert('注册失败');</script>";
}
}
$smarty->assign("regstatus",$response);
$smarty->display("reg.html");
?>