Java学习者论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

手机号码,快捷登录

恭喜Java学习者论坛(https://www.javaxxz.com)已经为数万Java学习者服务超过8年了!积累会员资料超过10000G+
成为本站VIP会员,下载本站10000G+会员资源,购买链接:点击进入购买VIP会员
JAVA高级面试进阶视频教程Java架构师系统进阶VIP课程

分布式高可用全栈开发微服务教程

Go语言视频零基础入门到精通

Java架构师3期(课件+源码)

Java开发全终端实战租房项目视频教程

SpringBoot2.X入门到高级使用教程

大数据培训第六期全套视频教程

深度学习(CNN RNN GAN)算法原理

Java亿级流量电商系统视频教程

互联网架构师视频教程

年薪50万Spark2.0从入门到精通

年薪50万!人工智能学习路线教程

年薪50万!大数据从入门到精通学习路线年薪50万!机器学习入门到精通视频教程
仿小米商城类app和小程序视频教程深度学习数据分析基础到实战最新黑马javaEE2.1就业课程从 0到JVM实战高手教程 MySQL入门到精通教程
查看: 743|回复: 0

两种跳转页面方法、蓝色页面搭配

[复制链接]

该用户从未签到

发表于 2011-10-20 14:34:37 | 显示全部楼层 |阅读模式
<%@ page language="java" contentType="text/HTML; charset=GBK"

    pageEncoding="GBK"%>

<%

String path = request.getContextPath();

String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<title>登陆首页</title>

    <meta http-equiv="Content-Type" content="text/html; charset=GBK">

    <meta http-equiv="pragma" content="no-cache">

    <meta http-equiv="cache-control" content="no-cache">

    <meta http-equiv="expires" content="0">   

<style type="text/css">

    .style3 {font-size: 18px; font-weight: bold; color:#003366 }

    .style5 {font-size: 15px; font-weight: bold; color:#003366 }

    .style7 {font-size: 14px; color:#003366}

    .style8 {font-size: 14}

</style>

<script language="javascript" type="text/javascript">

    function Login()

    {

        var name = document.getElementById("name").value;

        var password = document.getElementById("password").value;

        

        if(name=="")

        {

            alert("用户名不能为空!");

            return false;

        }

        

        if(password=="")

        {

            alert("密码不能为空!");

            return false;

        }

        if(name=="duan"&&password=="1"){

            var UserName="duan";

            window.location.href="<%=path %>/syncConfig.jsp?UserName="+UserName;

            return true;

        }

        if(name=="lin"&&password=="1"){

            var UserName="lin";

            url="<%=path %>/syncConfig.jsp?UserName="+UserName;

            document.form1.action=url;

              document.form1.submit();

            return true;

        }

        else{

           alert("用户名或密码错误!请从新登陆。");

           return false;

        }



    }

</script>

</head>

<body>

         <form id="form1" name="form1" method="post" action="" >

                <table width="370" border="1" align="center" cellpadding="0" cellspacing="1"  bordercolor="#a2c2ff">

                  <tr  bgcolor="#92b2ff">

                    <td height="24" colspan="2" align="center" class="style3">用户登陆</td>

                  </tr>

                  <tr  bgcolor="#a2c2ff">

                    <td width="104" class="style5">用户名:</td>

                    <td width="263"><label>

                      <input type="text" name="name" id="name" size="30" />

                    </label></td>

                  </tr>

                  <tr  bgcolor="#a2c2ff">

                    <td class="style5">密  码:</td>

                    <td><input type="text" name="password" id="password" size="30"/></td>

                  </tr>

                  <tr>

                    <td colspan="2" align="center"  bgcolor="#a2c2ff">

                      <input type="button" name="queding" id="queding" value="确定" onclick="Login()"/>

                      <input type="reset" name="chongzhi" id="chongzhi" value="重置" />

                      <input type="button" name="quxiao" id="quxiao" value="取消"  onclick="closeWindows()"/>

                    </td>

                  </tr>

                </table>

              </form>

</body>

<script type="text/javascript" language="javascript">

function closeWindows(){

   window.close();

}

</script>

</html>
回复

使用道具 举报

该用户从未签到

发表于 2011-10-21 17:30:55 | 显示全部楼层
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Java学习者论坛 ( 声明:本站资料整理自互联网,用于Java学习者交流学习使用,对资料版权不负任何法律责任,若有侵权请及时联系客服屏蔽删除 )

GMT+8, 2024-5-18 14:59 , Processed in 0.388860 second(s), 47 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表