php做的主页验证码
来源:互联网 发布:下载数据恢复 编辑:程序博客网 时间:2024/05/17 01:30
这是做的一个主页,有点简陋,但还算不错。。
<body>
<form name="form1" method="post" action="check.php" >
<table border="1" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td width="70" align="right"><span class="STYLE4">用户名</span></td>
<td width="100" align="left"><input type="text" name="username" id="username"></td>
</tr>
<tr>
<td align="right"><span class="STYLE4">密码</span></td>
<td align="left"><input type="password" name="password" id="password"></td>
</tr>
<tr>
<td width="70" align="right"><span class="STYLE4">验证码</span></td>
<td>
<input type="text" name="input1" > <img src="code.php"><hr>
</td>
</tr>
<tr>
<td align="right"> </td>
<td align="left"><input type="submit" name="submit" value="登录" id="submit">
<input type="reset" name="reset" id="reset" /></td>
</tr>
</table>
</form>
</div>
</body>
这里面的check.php
<?php
session_start();
include('conn.php');
[url=mailtoa=@strtoupper($_POST[]$a=@strtoupper($_POST["input1[/url]"]); //接受输入的验证码
[url=mailtob=@strtoupper($_SESSION[]$b=@strtoupper($_SESSION["code"]);//[/url]接受验证码
if($_POST['username']!=""&&$_POST['password']!=""){
//定义sql
$sql="SELECT * FROM admin where username='".$_POST['username']."' and password='".$_POST['password']."'";//判断用户名及密码不为空
$rs=mysql_query($sql);
if(mysql_num_rows($rs)){
$_SESSION['user']=$_POST['username'];
if($a==$b){ //用户名及密码判断之后 判断验证码
?>
<script type="text/javascript">
<!--
alert("登陆成功,确定后跳转到首页!");
location="header.php";
//-->
</script>
<?php
}else{
?>
<script type="text/javascript">
alert ("验证码错误!");location="index.php";
</script>
<?php
}
?>
<?php
}else{
?>
<script type="text/javascript">
alert("登陆失败,用户名或者密码错误!");
location="index.php";
</script>
<?php
}
}else {
?>
<script type="text/javascript">
alert("用户名或者密码不能为空!~");
location="index.php";
</script>
<?php
}
?>
<body>
<form name="form1" method="post" action="check.php" >
<table border="1" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td width="70" align="right"><span class="STYLE4">用户名</span></td>
<td width="100" align="left"><input type="text" name="username" id="username"></td>
</tr>
<tr>
<td align="right"><span class="STYLE4">密码</span></td>
<td align="left"><input type="password" name="password" id="password"></td>
</tr>
<tr>
<td width="70" align="right"><span class="STYLE4">验证码</span></td>
<td>
<input type="text" name="input1" > <img src="code.php"><hr>
</td>
</tr>
<tr>
<td align="right"> </td>
<td align="left"><input type="submit" name="submit" value="登录" id="submit">
<input type="reset" name="reset" id="reset" /></td>
</tr>
</table>
</form>
</div>
</body>
这里面的check.php
<?php
session_start();
include('conn.php');
[url=mailtoa=@strtoupper($_POST[]$a=@strtoupper($_POST["input1[/url]"]); //接受输入的验证码
[url=mailtob=@strtoupper($_SESSION[]$b=@strtoupper($_SESSION["code"]);//[/url]接受验证码
if($_POST['username']!=""&&$_POST['password']!=""){
//定义sql
$sql="SELECT * FROM admin where username='".$_POST['username']."' and password='".$_POST['password']."'";//判断用户名及密码不为空
$rs=mysql_query($sql);
if(mysql_num_rows($rs)){
$_SESSION['user']=$_POST['username'];
if($a==$b){ //用户名及密码判断之后 判断验证码
?>
<script type="text/javascript">
<!--
alert("登陆成功,确定后跳转到首页!");
location="header.php";
//-->
</script>
<?php
}else{
?>
<script type="text/javascript">
alert ("验证码错误!");location="index.php";
</script>
<?php
}
?>
<?php
}else{
?>
<script type="text/javascript">
alert("登陆失败,用户名或者密码错误!");
location="index.php";
</script>
<?php
}
}else {
?>
<script type="text/javascript">
alert("用户名或者密码不能为空!~");
location="index.php";
</script>
<?php
}
?>
- php做的主页验证码
- php做的简单验证码
- php开源博客框架: WordPress (适合做企业的主页)
- PHP的验证码
- 欢迎光临我新做的主页!
- 客户端进入主页要做的几件事
- php做所有的正则验证 如:身份证 QQ等等
- php:安全验证码,要么不做,要做一鸣惊人。
- 用php做的一张图片用于做验证可能会比较好用
- PHP验证码的实现
- php验证码的实现
- PHP验证码的实现
- PHP的验证码实现
- php基本的验证码
- php验证码的编写
- php验证码的制作
- php验证码的类
- PHP的验证码入门
- Qt 之 QGridLayout
- 截取字符串,中文不能截取半个
- Symbian Zip解压问题
- COM组件 接口(Interface)的来历
- Eclipse的使用秘籍,MyEclipse一样管用
- php做的主页验证码
- 鸡窝里的鹰
- mave2入门
- static_cast、dynamic_cast reinterpret_cast和const_
- poj1125floyd
- JSP 下载文件
- http://qgjie456.blog.163.com/blog/static/3545136720112305582651/
- linux 打开端口
- Asp.net 构建可扩展的的Comet Web 应用(一)