错误是Access denied for user: 'ODBC@localhost' (Using password: NO)
我之前用的也是空密码,也没出错,现在其他文件也没出错,就这一个出错,贴出代码如下<?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");
?>