Chinaunix

标题: 登录的问题? [打印本页]

作者: dscl521    时间: 2006-11-01 14:40
标题: 登录的问题?
每次输入正确的用户名和密码后,都会出现空白页,而不跳转到指定的mainad.php

<?php
$user=$_POST['user'];
$password=$_POST['password'];
if(isset($user) && strlen($user) > 0)
{
mysql_connect("localhost", "wyzx", "songzhiyuan");
mysql_select_db("wyzx") or die ("不能连接到数据库!");
$strSql = "SELECT * FROM user where user='$user' and password='$password';";
$result=mysql_query($strSql);
$num=mysql_fetch_array($result);

if(!empty($num[0]))
{
require("mainad.php");
}
else
{
require("login.php");
}
}
?>
作者: 笨狗    时间: 2006-11-02 06:10
没有找到你跳转的语句
在php里面做跳转,用header()函数
作者: dscl521    时间: 2006-11-02 07:53
明白了
谢谢




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2