【php开源代码栏目提醒】:本文主要为网学会员提供LoginResponse.php,希望对需要LoginResponse.php网友有所帮助,学习一下!
<html>
<head>
<title>用户登录</title>
</head>
<body>
<center>
<font size="5" color="blue">用户登录</font>
</center>
<hr>
<?
$link_ID = mysql_connect("localhost", "root");
//连结MySQL服务器。
my
sql_select_db("vote");
//指定使用vote数据库。
$str = "SELECT * FROM user
WHERE user_id='$user_id'
AND password='$pass
word';";
//建立查询字符串,筛选条件为必须符合user_id、password两字段的值,
$result =
mysql_query($str, $link_ID);
//提交
查询,并将结果放入$result变量中。
$record = mysql_fetch_row($result);
//取得结果,以数组传回,放在$record中
if (empty($record)) :
?>
<!--//若登录失败时才会执行至下面的语句-->
登录数据错误<a href="logfrm.htm">请重新登录</a>
<?else :?>
<h2>您好!</h2>
<p></p>
<table>
<tr align="left"><th colspan="3">
<font size="4" color="brown">投票区</font></th>
</tr>
<tr align="left">
<td colspan="3">
<a href="voteform.php">旅游地点</a></td>
</tr>
</table>
<?endif;?>
</body>
</html>