羽恒梦工厂项目前台登录注册
Posted 夜雨声烦丶
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了羽恒梦工厂项目前台登录注册相关的知识,希望对你有一定的参考价值。
前台登录和处理验证码挂了
这是代码login2
<?php session_start(); include("../dbda.class.php"); $db = new DBDA(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <link href="login.css" rel="stylesheet" type="text/css" /> <script src="../jquery-1.11.2.min.js"></script> <style> #top{ background-image:url(img/header.png); background-repeat:no-repeat; background-position:center; height:158px; width:100%; min-width:1347px; max-width:1920px;} #dhl_wai{margin:0 auto; text-align:center; width:1190px; height:35px} #logo{ margin:0 auto; text-align:center;width:290px; height:80px; position:relative; top:56px } #logo:hover{ cursor:pointer} .dhl{ float:left; font-size:26px; width:80px; margin:0 33px; position:relative;} .dhl:hover{ cursor:pointer; color:#faa66a} .right{ margin-left:343px} #second{background-image:url(img/banner.png); background-repeat:no-repeat; background-position:center; height:308px; width:100%; min-width:1347px; max-width:1920px} </style> </head> <body> <!--导航--> <div id="top"> <div id="dlxx"> </div> <div id="logo"><img src="img/logo.png" /></div> <div id="dhl_wai"> <?php $dhlb = "select * from leibie"; $dh = $db->Query($dhlb); foreach($dh as $k=>$v){ $class = $k==3?"dhl right":"dhl" ; echo "<div class=\'{$class}\' code=\'{$v[0]}\'>{$v[2]}</div>"; } ?> </div> </div> <div style="clear:both"></div> <!--中间图--> <div id="second"></div> <div style="clear:both"></div> <!--登录界面--> <div id="login_dlb"> <div id="login_dl"> <div style="font-size:26px">会员登录</div> <div style="height:20px"></div> <div id="login_uid">用户名 <input type="text" style="height:25px; width:250px" id="uid" /></div> <div style="height:20px"></div> <div id="login_pwd"> 密码 <input type="password" style="height:25px; width:250px" id="pwd" /></div> <div style="margin-top:15px">验证码<input id="yzm" type="text" style="height:25px; margin-left:12px" /><img src="ceshi3.php" onclick="javascript:this.src=\'ceshi3.php?tm=\'+Math.random()" style="margin-left:10px; position:relative; top:7px" /> </div><div style="height:20px; width:120px" id="yz"></div> <div style="position:relative; left:150px; top:20px"> <div style=" float:left;"><input style="width:57px; height:25px; background-color:#F60; border-radius:7px ;color:#FFF" type="button" value="登录" id="btn" /></div> <div style=" float:left; width:40px; height:25px"></div> <div style=" float:left"> <a href="zhuce.php"><input style="width:57px; height:25px; background-color:#999; border-radius:7px; color:#FFF" type="button" value="注册" /></a></div> </div> </div> </div> <div style="clear:both"></div> <!--最下面--> <div id="login_zxm" style="background-image:url(images/1111_02.jpg)" )> </div> <script type="text/javascript"> $(document).ready(function(e) { dengluxx(); $("#btn").click(function(){ var uid = $("#uid").val(); var pwd = $("#pwd").val(); var yzm = $("#yzm").val(); $.ajax({ url:"loginchuli.php", data:{uid:uid,pwd:pwd,yzm:yzm}, type:"POST", dataType:"TEXT", success: function(data){ if(data.trim()=="OK") { window.location.href="main.php"; } else if(data.trim()=="no") { alert ("用户名或密码错误"); } else if(data.trim()=="yzm") { $("#yz").html("验证码不正确"); $("#yz").css("color","red"); } } }); }) }); //导航 $(document).ready(function(e) { $.ajax({ url:"dhchuli.php", dataType:"TEXT", success: function(data){ var hang=data.split("|"); var str=""; for(var i=0;i<5;i++){ if(i==3){ var lie=hang[i].split("^"); str+="<a href=\'buju.php?code="+lie[1]+"\'><div class=\'daohang_11\'>"+lie[2]+"</div></a>"; }else{ var lie=hang[i].split("^"); str+="<a href=\'buju.php?code="+lie[1]+"\'><div class=\'daohang_21\' code=\'"+lie[1]+"\'>"+lie[2]+"</div></a>"; } } $("#dh_jieshou").html(str); } }); }); function dengluxx(){ $("#dl").click(function(){ window.location.href="login2.php"; }); $("#zc").click(function(){ window.location.href="zhuce.php"; }); $("#zhuxiao").click(function(){ $.ajax({ url:"./chuli/htshjchuli.php", data:{tp:5}, type:"POST", success: function(data){ window.location.href="login2.php"; } }); }); $("#huiyuanzhx").click(function(){ window.location.href="yhfukuanjilu.php"; }); $("#yonghuming").click(function(){ window.location.href="xiugaimm.php"; }); $("#logo").click(function(){ window.location.href="main.php"; }); $(".dhl").click(function(){ var code = $(this).attr("code"); window.location.href="buju.php?code="+code+""; }); } </script> </body> </html>
下面是loginchuli
<?php session_start(); $yz = $_SESSION["yzm"]; $uid = $_POST["uid"]; $pwd = $_POST["pwd"]; $yzm = $_POST["yzm"]; include("../DBDA.class.php"); $db = new DBDA(); $sql = "select pwd from login where uid=\'{$uid}\'"; $mm = $db->StrQuery($sql); if($yz==$yzm){ if($mm == $pwd && $pwd!="") { $_SESSION["uid"]=$uid; echo "OK"; } else { 羽恒梦工厂个人中心适合Java语言新手入门练习的框架个人网站项目,目前主要维护网络mysql和网络psql两个分支。前台包括博客、代码库、文件下载、留言、登录注册、站内搜索、分类目录等功能,后台包括上传文件、博客、代码