登录的问题——快要崩溃了
比如说登陆页面,老是提示:“用户名或密码错误!”
用户是刚刚添加进去的,密码也对,怎么会提示错误呢?不应该啊
注:所有的编码都是:gb2312
进入phpmyadmin设置 MySQL 连接校对:gb_2312_chinese_ci
表里的“整理”也都是gb2312_chinese_ci
连接数据库时设置:mysql_query("set names 'gb2312'");
现在应该排除编码问题了吧?
那程序有问题?
上代码
登陆页面:
<form method="post" action="login.php">
<div align="center"><br><br><br><br><br><br>
<img src="../images/wyxback.gif"><br>
<table width="300px" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td bgcolor="#666666" style="height: 26px; width: 120px;">
<div align="center">
<span style="color: #ffffff">用户名:</span></div>
</td>
<td bgcolor="#666666" style="height: 26px; width: 180px;">
<div align="left"> <input name="wyx_name" type="text" size="18"/></div>
</td>
</tr>
<tr>
<td bgcolor="#666666" style="height: 28px; width: 120px;">
<div align="center">
<span style="color: #ffffff">密 码:</span></div>
</td>
<td bgcolor="#666666" style="height: 28px; width: 180px;">
<div align="left"><input name="wyx_pass" type="password" size="19"/></div>
</td>
</tr>
<tr>
<td bgcolor="#666666" style="height: 28px; width: 120px;">
<div align="center">
<span style="color: white">验证码:</span></div>
</td>
<td bgcolor="#666666" style="height: 28px; width: 180px;">
<div align="left"><input name="wyx_yzm" type="text" size="10"/>
<img src="VerifyCode.php" />
</div>
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#666666" style="text-align: center">
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#666666" style="text-align: center" height="30">
<input type="submit" name="submit" value="登 录" />
</td>
</tr>
</table>login.php页面:
<?php
include('../config.php');
//验证码
$pageRandCode=$_POST['wyx_yzm'];
session_start();
if($_SESSION['verifyCode'] <> $pageRandCode)
{
echo '<script>alert("验证码有误!");
location.replace ("index.php")</script>';
}
else
{
$wyx_name = $_POST['wyx_name'];
$wyx_pass = md5(trim($_POST['wyx_pass']));
$sql="select * from wyx_user where wyx_name='$wyx_name'&&wyx_pass='$wyx_pass'";
$sql=@mysql_query($sql);
if($rs=@mysql_fetch_array($sql))
{
setcookie("wyx",$wyx_name,time()+3600000);
header("Location:admin_index.php");
}
else
{
$str="<SCRIPT language=JavaScript>alert(' 用户名或密码错误!');javascript:history.go(-1)</SCRIPT>";
echo $str;
}
}
?>相关推荐
上海立信会计金融学院学生自主开发的自动化选课辅助工具_针对学校选课系统高并发易崩溃问题设计的Python多线程网络爬虫脚本_帮助学生在教务系统选课时自动登录并抢占心仪课程名额_包含.zip
上海立信会计金融学院学生自主开发的自动化选课辅助工具_针对学校选课系统高并发易崩溃问题设计的Python多线程网络爬虫脚本_帮助学生在教务系统选课时自动登录并抢占心仪课程名额_包含.zip
linux服务器显卡崩溃解决方案
主要介绍了linux服务器显卡崩溃解决方案,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
关于内存溢出导致的服务器崩溃问题分享
关于内存溢出导致的服务器崩溃问题分享
SQL Server成功与服务器建立连接但是在登录过程中发生错误的快速解决方案
最近在VS2013上连接远程数据库时,突然连接不上,在跑MSTest下跑的时候,QTAgent32 crash。换成IIS下运行的时候,IIS crash。之前的连接是没问题的,后网上找了资料,根据牛人所说的方案解决了。 1. Exception message 已成功与服务器建立连接,但是在登录过程中发生错误。 (provider: SSL Provider, error: 0 – 接收到的消息异常,或格式不正确。) —> System.ComponentModel.Win32Exception: 接收到的消息异常,或格式不正确。 2. Solution 以管理员的身份运行“命令管理器”,输
Rstudio-server登录问题全解析:从卡死到崩溃的终极排查指南
本文全面解析RStudio-Server登录卡死、崩溃等常见问题的排查与解决方法。从网络地址、浏览器环境等基础检查,到服务器进程管理、内存清理等深度诊断,提供了从简单到复杂的完整排查流程和终极解决方案,帮助用户快速恢复数据分析工作。


基础编程
