供大家参考
<?php
error_reporting(0);
header("content_type:text/html;charset=gbk");
$conn=mysql_connect("localhost","root","") or die("链接错误");
mysql_select_db("phptest",$conn);
// echo "链接成功"."<br>";
$username=$_POST['username'];
$password=$_POST['password'];
// echo "用户输入的是:"."$username"."<br>"."$password";
$sqla="select * from user";
$sqlb="select * from user where username='$username'";
$sqlc="select * from user where username='$username' and password='$password'";
$resulta=mysql_query($sqla,$conn);
$resultb=mysql_query($sqlb,$conn);
$resultc=mysql_query($sqlc,$conn);
$numa=mysql_num_rows($resulta);
$numb=mysql_num_rows($resultb);
$numac=mysql_num_rows($resultc);
if($username=="" or $password==""){
echo "用户名或密码不能为空";
}else if($numb>0 ){
while($all=mysql_num_rows($result)){
echo "$all[username]"." "."$all[password]"."<br>";
}
}
?>
<html>
<body>
<form action="newTest.php" method="post">
<ul>
<li>username:<input type="text" name="username"/></li>
<li>password:<input type="text" name="password"/></li>
<li><input type="submit" name="sub"value="sub"/></li>
</ul>
</form>
</body>
</html>
分享到:
相关推荐
// 注册页面代码 $yh=$_REQUEST['zhanghao']; // 表单账号 $mim=$_REQUEST['mm']; // 表单密码 $mima=$_REQUEST['mima']; // 表单确认密码密码 if($mim!=$mima){ echo "两次密码不相同"; exit; } $dd=new mysqli('...
qq登录代码
注册登录连接数据库用代码的! if (document.send.username.value=="") { window.alert('请输入用户名!'); return false; } if (document.send.username.value.length) { window.alert('用户名长度必须...
PHP用户注册、登录、退出源代码,包含文件 PHP_用户登录与退出.txt PHP_简单注册页面代码.txt
使用php服务器网络语言实现连接mysql数据库的后台处理程序,代码经过主机屋免费主机测试过,可用记事本打开查看
登录注册页面
PHP5标准的登录和注册页面的代码,对学习PHP的初学者很有参考研究。
使用qq登录php代码
一个简单实现php登录的界面,配置好php环境后,运行login.php,随便输入一个用户名和密码,点击登录,就跳转到另一个页面,显示出刚才输入的信息。
php短信接口代码
\php上课实例之登录代码\php上课实例\php上课实例之登录代码之登录代码
PHP WEB QQ授权登录代码
php登陆代码,简单操作性很强,主要基于登录框
这是一套简单的PHP会员登录代码,非常简单,但包括了登录、退出、判断是否是会员以显示不同的内容等功能。学习起来快捷方便。
支付宝快捷登录代码1 在模板文件夹下library/member_info.lbi中/if前面加入 <a title="支付宝账号直接登陆" href="alipayLogin/auth_authorize.php?type=user" name="fastlogin"&...
php原生许愿墙代码,可以登录注册,只有登录以后才能许愿,可以删除自己的愿望等
本压缩包包含了一套完整的php实现注册登录代码文件,包含非常详细的教程,包含验证码功能,适合新手学习,借鉴,欢迎下载使用。
介绍的是一个简单的php实现的用户登录与验证类的代码,没有把登录和数据库查询分开,cookie设置,数据库设置,用户获取值,验证SESSION,验证COOKIE。
php session登录。附数据表执行SQL,HTML前端代码,PHP代码。
php注册登陆验证模块包含界面 极大地方便php开发注册用户的需要