s textfield readonly:php 高手请进来看看

来源:百度文库 编辑:高考问答 时间:2024/04/29 22:52:15
include_once("tconn.php");
$name=$_POST['name'];
$pwd=$_POST['pwd'];
if ($name=="" || $pwd==""){echo "<script>alert('用户名或密码不可以为空!');history.go(-1);</script>";
exit;
}
opendb();
$sql="select id, username, password from sql_users where username='$name' and password='$pwd'";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$id = $row[id] ;
if ($id!="") {
session_start();
session_register("username");
$username=$row[username];
header("location:index.php");
}
else {
echo "<script>alert('帐号或密码错误!');history.go(-1);</script>";
}
closedb();

以上代码为什么在php4.4中不能执行