羽恒梦工厂项目前台登录注册

 前台登录和处理验证码挂了

这是代码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">用户名&nbsp;&nbsp;<input type="text" style="height:25px; width:250px" id="uid" /></div>
    <div style="height:20px"></div>
    <div id="login_pwd">&nbsp;&nbsp;&nbsp;密码&nbsp;&nbsp;<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
    {
        echo "NO";
    }
}else{echo "yzm";}
?>

这个页面是产生随机验证码的处理页面

<?php
session_start();
//产生一个随机的字符串验证码
$checkcode="";
for ($i=0;$i<4;$i++){
 $checkcode.=dechex(rand(0,15)); //string dechex ( int $number ) 返回一字符串,包含有给定 number 参数的十六进制表示
}
//将随机验证码保存到session中
$_SESSION['yzm']=$checkcode;
//创建图片,并把上面产生的随机验证码画上去
$img=imagecreatetruecolor(100, 26);
//背景默认是黑色,可以自己设定背景颜色
$bgcolor=imagecolorallocate($img, 0, 0, 0);
//imagefill() 在 image 图像的坐标 x,y(图像左上角为 0, 0)处用 color 颜色执行区域填充(即与 x, y 点颜色相同且相邻的点都会被填充)。
imagefill($img, 0, 0, $bgcolor);
//创建新的颜色 imagecolorallocate — 为一幅图像分配颜色
//imagecolorallocate() 返回一个标识符,代表了由给定的 RGB 成分组成的颜色。
//red,green 和 blue 分别是所需要的颜色的红,绿,蓝成分。这些参数是 0 到 255 的整数或者十六进制的 0x00 到 0xFF。
//imagecolorallocate() 必须被调用以创建每一种用在 image 所代表的图像中的颜色
$white=imagecolorallocate($img, 255, 255, 255);
$blue=imagecolorallocate($img, 0, 0, 255);
$red=imagecolorallocate($img, 255, 0, 0);
$green=imagecolorallocate($img, 255, 0, 0);
//画出干扰线段
for($i=0;$i<10;$i++){
 //bool imageline ( resource $image , int $x1 , int $y1 , int $x2 , int $y2 , int $color )
 //imageline() 用 color 颜色在图像 image 中从坐标 x1,y1 到 x2,y2(图像左上角为 0, 0)画一条线段。
 imageline($img, rand(0, 100), rand(0, 20), rand(0, 100), rand(0, 20), imagecolorallocate($img, rand(0, 255), rand(0, 255), rand(0, 255)));
}
//画出噪点
//for(){}
//把上面产生的四个随机值,字符串画上去
//bool imagestring ( resource $image , int $font , int $x , int $y , string $s , int $col )
//imagestring() 用 col 颜色将字符串 s 画到 image 所代表的图像的 x,y 坐标处(这是字符串左上角坐标,整幅图像的左上角为 0,0)。
//如果 font 是 1,2,3,4 或 5,则使用内置字体。
imagestring($img, rand(2, 5), rand(2, 60), rand(2, 5), $checkcode, $white);
header("content-type:image/png");
//imagepng() 将 GD 图像流(image)以 PNG 格式输出到标准输出(通常为浏览器),或者如果用 filename 给出了文件名则将其输出到该文件。
imagepng($img);

?>

 

然后下面是注册

<?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}
.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="login_tu"></div>
<div style="clear:both"></div>    


<!--登录界面-->
<div id="login_dlb">
<div id="login_dl2">
    
    <div style="height:30px" id="ts"></div>
    <div id="login_uid2">注册新用户名&nbsp;&nbsp;<input type="text" style="height:25px; width:250px" id="zc_uid" /></div>(请输4-10位英文和数字组合的字符)
    <div style="height:20px"></div> 
    <div id="login_pwd2">请输入你密码&nbsp;&nbsp;<input type="password" style="height:25px; width:250px" id="zc_pwd"  /></div>(请输入4-10位英文和数字组合的字符)
    <div style="height:20px"></div>   
    <div id="login_pwd22">再次输入密码&nbsp;&nbsp;<input type="password" style="height:25px; width:250px" id="zc_pwd2"  /></div> (请再次输入您的密码) 
    <div style="position:relative; left:150px; top:20px">
        
    <div style=" float:left; width:40px; height:25px"></div>
    <div style=" float:left"> <input style="width:127px; height:35px; background-color: #C90; border-radius:7px; color:#FFF" type="button" value="立刻注册" id="zhuce" /></div>
    <div style=" float:left; width:20px; height:35px"></div>
    <div style=" float:left"> <a href="login2.php"><input style="width:47px; height:35px; background-color: #096; border-radius:7px; color:#FFF" type="button" value="取消" id="zhuce" /></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();
    $("#zc_uid").blur(function(){
     
        
        var zc_uid = $("#zc_uid").val();
        
        if(zc_uid.trim().length==zc_uid.length){
            if(zc_uid.indexOf(" ")==-1){
                if(zc_uid.trim().length>3 && zc_uid.trim().length<11){
            
        $.ajax({
            url:"uidchuli.php",
            data:{u:zc_uid},
            type:"POST",
            dataType:"TEXT",
            success: function(data){
                    if(data>0)
                    {
                        $("#ts").html("该用户名已存在");
                        $("#ts").css("color","red");
                    }
                    else
                    {
                        $("#ts").html("该用户名可用");
                        $("#ts").css("color","green");
                    }
                }
            
            });
        }else{
            
            $("#ts").html("账号长度太短或太长");
            $("#ts").css("color","red");
            }
        }else{
            $("#ts").html("账号不能输空格");
            $("#ts").css("color","red");
            }
        }else
        {
            $("#ts").html("账号不能输空格");
            $("#ts").css("color","red");
            }
        })


    
       $("#zhuce").click(function(){
        
        
        var zc_uid = $("#zc_uid").val();
        var zc_pwd = $("#zc_pwd").val();
        var zc_pwd2 = $("#zc_pwd2").val();
         if(zc_uid.trim().length==zc_uid.length){
        if(zc_pwd==zc_pwd2 && zc_pwd.trim().length>3){
            if(zc_pwd.indexOf(" ")==-1){
        
        $.ajax({            
            url:"zhucechuli.php",
            data:{zc_uid:zc_uid,zc_pwd:zc_pwd,zc_pwd2:zc_pwd2},
            type:"POST",
            dataType:"TEXT",
            success: function(data){
                 if(data==1){
                     
                     alert("注册成功");
                     window.location.href="login2.php";
                     
                     }
                     else{
                        
                        alert("注册失败");
                        }
            
                }
            
            });
        
 }else{
           alert("两次输入密码不一致或您输入密码过短")
           }
       }
       else{
            alert("密码不能有空格")
           }
         }else{
             alert("密码不能有空格")
             }
        })
        
        
       
});


//导航
$(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>

 

下面是注册处理 zhucechuli.php

<?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}
.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="login_tu"></div>
<div style="clear:both"></div>    


<!--登录界面-->
<div id="login_dlb">
<div id="login_dl2">
    
    <div style="height:30px" id="ts"></div>
    <div id="login_uid2">注册新用户名&nbsp;&nbsp;<input type="text" style="height:25px; width:250px" id="zc_uid" /></div>(请输4-10位英文和数字组合的字符)
    <div style="height:20px"></div> 
    <div id="login_pwd2">请输入你密码&nbsp;&nbsp;<input type="password" style="height:25px; width:250px" id="zc_pwd"  /></div>(请输入4-10位英文和数字组合的字符)
    <div style="height:20px"></div>   
    <div id="login_pwd22">再次输入密码&nbsp;&nbsp;<input type="password" style="height:25px; width:250px" id="zc_pwd2"  /></div> (请再次输入您的密码) 
    <div style="position:relative; left:150px; top:20px">
        
    <div style=" float:left; width:40px; height:25px"></div>
    <div style=" float:left"> <input style="width:127px; height:35px; background-color: #C90; border-radius:7px; color:#FFF" type="button" value="立刻注册" id="zhuce" /></div>
    <div style=" float:left; width:20px; height:35px"></div>
    <div style=" float:left"> <a href="login2.php"><input style="width:47px; height:35px; background-color: #096; border-radius:7px; color:#FFF" type="button" value="取消" id="zhuce" /></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();
    $("#zc_uid").blur(function(){
     
        
        var zc_uid = $("#zc_uid").val();
        
        if(zc_uid.trim().length==zc_uid.length){
            if(zc_uid.indexOf(" ")==-1){
                if(zc_uid.trim().length>3 && zc_uid.trim().length<11){
            
        $.ajax({
            url:"uidchuli.php",
            data:{u:zc_uid},
            type:"POST",
            dataType:"TEXT",
            success: function(data){
                    if(data>0)
                    {
                        $("#ts").html("该用户名已存在");
                        $("#ts").css("color","red");
                    }
                    else
                    {
                        $("#ts").html("该用户名可用");
                        $("#ts").css("color","green");
                    }
                }
            
            });
        }else{
            
            $("#ts").html("账号长度太短或太长");
            $("#ts").css("color","red");
            }
        }else{
            $("#ts").html("账号不能输空格");
            $("#ts").css("color","red");
            }
        }else
        {
            $("#ts").html("账号不能输空格");
            $("#ts").css("color","red");
            }
        })


    
       $("#zhuce").click(function(){
        
        
        var zc_uid = $("#zc_uid").val();
        var zc_pwd = $("#zc_pwd").val();
        var zc_pwd2 = $("#zc_pwd2").val();
         if(zc_uid.trim().length==zc_uid.length){
        if(zc_pwd==zc_pwd2 && zc_pwd.trim().length>3){
            if(zc_pwd.indexOf(" ")==-1){
        
        $.ajax({            
            url:"zhucechuli.php",
            data:{zc_uid:zc_uid,zc_pwd:zc_pwd,zc_pwd2:zc_pwd2},
            type:"POST",
            dataType:"TEXT",
            success: function(data){
                 if(data==1){
                     
                     alert("注册成功");
                     window.location.href="login2.php";
                     
                     }
                     else{
                        
                        alert("注册失败");
                        }
            
                }
            
            });
        
 }else{
           alert("两次输入密码不一致或您输入密码过短")
           }
       }
       else{
            alert("密码不能有空格")
           }
         }else{
             alert("密码不能有空格")
             }
        })
        
        
       
});


//导航
$(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>

注册时候有验证什么的。

<?phpinclude("../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>#dlxx{ margin:0 0 0 auto; text-align:right; height:10px; position:relative; top:10px}#yonghuming{ width: auto; max-width:160px; text-align:center;}#zhuxiao{ width:46px; text-align:center;}#huiyuanzhx{ width:76px; text-align:center}#dl{ width:46px; text-align:center;}#zc{ width:46px; text-align:center;}
.yh{ float:left;}.yh:hover{ cursor:pointer}#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:35px }#logo:hover{ cursor:pointer}.dhl{ float:left; font-size:26px; width:80px; margin:0 33px; position:relative; top:-10px}.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="zhuye"><div id="zhuye_da">
<?php$sql="select code,main_pic from main where video_leibie=6";$attr =$db->Query($sql);foreach($attr as $v){echo "<div class='zhuye_x'>";echo "<a href='xiangqing.php?code={$v[0]}'><img class='zhuye_t' src='{$v[1]}' /></a>";echo "</div>";}
?>        </div></div>     <!--最下面--><script>$(document).ready(function(e) {dengluxx();    $.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_1'>"+lie[2]+"</div></a>";}else{var lie=hang[i].split("^");str+="<a href='buju.php?code="+lie[1]+"'><div class='daohang_2' code='"+lie[1]+"'>"+lie[2]+"</div></a>";}}$("#dh_jieshou").html(str);}});});
function dengluxx(){$.ajax({url:"./chuli/htshjchuli.php",async:false,data:{tp:4},type:"POST",dataType:"TEXT",success: function(data){$("#dlxx").html(data);}});var yh = $("#yonghuming").width();var zx = $("#zhuxiao").width();var hyzx = $("#huiyuanzhx").width();var dl = $("#dl").width();var zc = $("#zc").width();$("#dlxx").width(yh+zx+hyzx+dl+zc+26);$("#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>

posted @ 2016-12-04 14:14  夜雨声烦丶  阅读(228)  评论(0编辑  收藏  举报