21,893
社区成员




<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>
<?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;
}
}
?>
$sql="select * from wyx_user where wyx_name='$wyx_name'&&wyx_pass='$wyx_pass'";
$sql=@mysql_query($sql);
mysql_query("set names 'gb2312'"); //要不在这里加上这句
$rs=@mysql_fetch_array($sql);
echo $rs[0]."and",$rs[1]; //echo 一下看看
if($rs)
{
<?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'and wyx_pass='$wyx_pass'";
echo $sql;
$query=@mysql_query($sql);
if($rs=@mysql_fetch_array($query))
{
setcookie("wyx",$wyx_name,time()+3600000);
header("Location:admin_index.php");
}
else
{
$str="<SCRIPT language=JavaScript>alert(' 用户名或密码错误!');javascript:history.go(-1)</SCRIPT>";
echo $str;
}
}
?>
$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);
$rs=@mysql_fetch_array($sql);
if($rs)
{
setcookie("wyx",$wyx_name,time()+3600000);
header("Location:admin_index.php");
}
else
{
$str="<SCRIPT language=JavaScript>alert(' 用户名或密码错误!');javascript:history.go(-1)</SCRIPT>";
echo $str;
}