<?php
/*
* Created on 2010-4-30
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
include("conn.php"); $adminname=$_POST['username'];
$adminpass=$_POST['password']; $sql= mysql_query("select * from admin where adminname='".$adminname."'and adminpass='".$adminpass."'"); $info=mysql_fetch_array($sql);
//if (!$query) echo "SQL错误:".mysql_error();//怎么不能输出?if(!$info)
{
echo "<script \"JavaScript\">alert('您输入的用户名不存在!请重新输入!'); history.back(-1);</script>";
exit;
}
else
{
echo "<script language=javascript>alert=('登陆成功');history.backe(-1);windows.location.href='main.php';</script>";
}
?>
/*
* Created on 2010-4-30
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
include("conn.php"); $adminname=$_POST['username'];
$adminpass=$_POST['password']; $sql= mysql_query("select * from admin where adminname='".$adminname."'and adminpass='".$adminpass."'"); $info=mysql_fetch_array($sql);
//if (!$query) echo "SQL错误:".mysql_error();//怎么不能输出?if(!$info)
{
echo "<script \"JavaScript\">alert('您输入的用户名不存在!请重新输入!'); history.back(-1);</script>";
exit;
}
else
{
echo "<script language=javascript>alert=('登陆成功');history.backe(-1);windows.location.href='main.php';</script>";
}
?>
解决方案 »
- drupal6和ucenter home怎么实现共同登录
- php+smarty生成静态的新闻列表该怎么做?
- 关于点击链接触发事件的问题
- 急招PHP助理程序员(深圳) 待遇2K-4K 完全没有开发经验都可以,详细请看内容.
- 判断远程图片URL的问题
- php导出Excel如何不显示字段名
- 安装了phptriad以后,怎样使apache进入系统自动运行服务?
- 关于PHP中向MYSQL中写入数据的问题(急,在线求助,有点长,请大家耐心看一下)
- 请大家推荐好一点的PHP+MYSQL论坛程序
- php动态网页实时转成html的程序,请大家指教
- 奇怪的问题:PHP中urlencode()编码出错
- php连接access的问题
前面没有“=”。
另外 history.backe(-1); 后面是不是back啊, 应改成history.back(-1);。我试过了,应该能显示的。 希望能帮到你
{
echo "<script>alert('您输入的用户名不存在!请重新输入!'); history.back(-1);</script>";
exit;
}
else
{
echo "<script>alert('登陆成功');history.backe(-1);windows.location.href='main.php';</script>";
}
{
echo "<script type='text/javascript'>alert('您输入的用户名不存在!请重新输入!'); history.back(-1);</script>";
exit;
}
else
{
echo "<script type='text/javascript'>alert('登陆成功');windows.location.href='main.php';</script>";
}