php 登陆验证码通不过

来源:百度知道 编辑:UC知道 时间:2024/06/24 09:01:09
老是提示验证码不正确,高手们帮我看看。

验证代码如下:
<?php

session_start();
include("conn.php"); //数据库连接

$CheckCode=$_POST['CheckCode'];

$username=$_POST['user_name'];

$password=$_POST['user_password'];

$sql="select * from [user] where username='".$username."'";

$rs=mssql_query($sql);
$row=mssql_fetch_row($rs);

if(strtolower($CheckCode)!=$_SESSION['authnum']){

echo "<script>alert('校验码不正确!');window.location.href='login.php';</script>";

exit;

}

if ($row>0)

{ if ($rs['password']==$password)

{$_SESSION['admin']="OK";

header("location:admin_index.php");

}

else echo"<script>alert('密码不正确!');window.location.hre

<?php
session_start();

$CheckCode=@$_POST['CheckCode'];

$chak=@$_POST['yes'];
if($chak != "ok"){
?> <form action="abc.php" method="post" >

验证码:<input type='text' name='CheckCode' /><img src='换成你的这个产生验证码代码页面' />
<input type="hidden" name="yes" value="ok">
<input type="submit" value="提交">
</form>
<?php
}else{

if(strtolower($CheckCode)!=$_SESSION['authnum']){

echo "<script>alert('校验码不正确!');window.location.href='abc.php';</script>";

exit;
}else{
echo "对的checkcode=".$CheckCode."相等于session(authum)".$_SESSION['authnum'];
echo "<script>alert('校验码正确!');window.location.href='bcd.ph