代码如下:
<?php
   include "../inc/mysql.inc";
include "../inc/myfunction.inc";
$aa=new mysql;
$bb=new myfunction;
$aa->link("");
    $_SESSION[manage_name]="";
$_SESSION[manage_tag]="";
$login=$_POST[login];
if ($login=="登 陆"){
$username=$_POST[username];
$password=$_POST[password];
if ($username!="" && $password!=""){
$query="select * from manage_user_info where user_name='$username'";
$rst=$aa->excu($query);
$user=mysql_fetch_array($rst,MYSQL_ASSOC);
if ($user[user_pw]==$password){
$_SESSION[manage_name]=$user[user_name];
$_SESSION[manage_tag]=1;
header("location:./index.php");
}
}
}
?>

解决方案 »

  1.   

    在phpmyadmin里面插入了管理员的数据,管理员名称和密码都为admin,为什么点击登录后还是没有反应啊?
    求帮助~~~
      

  2.   


    header("location:./index.php");
    去掉./,这样写:header(location:index.php)
    试试
      

  3.   

    这个没问题啊,我是放在manage文件夹下的,所以要返回根目录。
      

  4.   

    select * from manage_user_info where user_name='$username        先不说为什么没有反应,的sql 只判断用户名  ?  密码不管了?
      

  5.   

    没有进入if分支。 你的提交value是等于“登 陆”吗。注意中间有个空格。还有页面没有session_start(); 
      

  6.   

    指向当前目录下的index.php,把点去掉,返回根目录
      

  7.   

    我另外定义了一个session.inc文件,可以直接指向login,也注意了中间那个空格了呀,不知道为什么还是不跳转。
      

  8.   

    后面有if语句判断呀,我用了MYSQL_ASSOC关联索引的~
      

  9.   

    你的提交页面中的action指向哪?后面有参数否?是否接收到传递的数据,把$_GET和$_POST打出来看看是否有数据丢失。按钮是否是submit类型,是Button类型还要添加提交事件。
    如果后台程序没错,而且点击"登录"没有反应,那就是前段页面有问题。
    还有所有html标签的属性最好都用英文,中文会产生许多不必要的麻烦。
      

  10.   

    你确定$_POST[username]可以输出吗?我试验后是不行
    Notice: Use of undefined constant username - assumed 'username'
    代码写规范点,有花不了多少时间。$_POST['username']
      

  11.   

    嘿嘿,谢谢你的回复啊,以后我会注意规范自己的code,问题找到了,不是login的跳转问题,是本身index页面的问题。