代码如下:
<?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");
}
}
}
?>
<?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");
}
}
}
?>
解决方案 »
- 如何从发走的url链接获取其返回的结果
- 急!!高分求教!!各高手请看一下吧???关于调试中:这个提示问题:我该怎么改呢??调试错误: 行 49 - Call to undefined function mysql_pconnect()
- 检测字符串里有没有800开头的
- 请教一个入门问题
- 根据访问的不同域名,转发到特定目录
- php生成后缀为html文件
- 奇怪了,为什么asp能运行,php就显示您未被授权查看该页。
- 小弟写的第一个php留言板,这边开源请大家指教,另一个小问题请大家帮忙解决。
- ThinkPHP写插件机制~求指导
- 请教:$_POST[]和$_GET[]
- php裁剪图片中的指定位置区域
- class类里的变量如何输出
求帮助~~~
header("location:./index.php");
去掉./,这样写:header(location:index.php)
试试
如果后台程序没错,而且点击"登录"没有反应,那就是前段页面有问题。
还有所有html标签的属性最好都用英文,中文会产生许多不必要的麻烦。
Notice: Use of undefined constant username - assumed 'username'
代码写规范点,有花不了多少时间。$_POST['username']