首页技术html网页登录界面代码?完整html网页代码

html网页登录界面代码?完整html网页代码

编程之家2026-06-29642次浏览

大家好,关于html网页登录界面代码很多朋友都还不太明白,今天小编就来为大家分享关于完整html网页代码的知识,希望对各位有所帮助!

html网页登录界面代码?完整html网页代码

html网页登录界面跳转设计

下面列了五个例子来详细说明,这几个例子的主要功能是:在5秒后,自动跳转到同目录下的hello.html(根据自己需要自行修改)文件。

1) html的实现

<head>

<!--以下方式只是刷新不跳转到其他页面-->

<meta http-equiv="refresh" content="10">

<!--以下方式定时转到其他页面-->

html网页登录界面代码?完整html网页代码

<meta http-equiv="refresh" content="5;url=hello.html">

</head>

优点:简单

缺点:Struts Tiles中无法使用

2) javascript的实现

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

html网页登录界面代码?完整html网页代码

//以下方式直接跳转

window.location.href='hello.html';

//以下方式定时跳转

setTimeout("javascript:location.href='hello.html'", 5000);

</script>

优点:灵活,可以结合更多的其他功能

缺点:受到不同浏览器的影响

3)结合了倒数的javascript实现(IE)

<span id="totalSecond">5</span>

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

var second= totalSecond.innerText;

setInterval("redirect()", 1000);

function redirect(){

totalSecond.innerText=--second;

if(second<0) location.href='hello.html';

}

</script>

优点:更人性化

缺点:firefox不支持(firefox不支持span、div等的innerText属性)

3')结合了倒数的javascript实现(firefox)

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

var second= document.getElementById('totalSecond').textContent;

setInterval("redirect()", 1000);

function redirect()

{

document.getElementById('totalSecond').textContent=--second;

if(second< 0) location.href='hello.html';

}

</script>

4)解决Firefox不支持innerText的问题

<span id="totalSecond">5</span>

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

if(navigator.appName.indexOf("Explorer")>-1){

document.getElementById('totalSecond').innerText="my text innerText";

} else{

document.getElementById('totalSecond').textContent="my text textContent";

}

</script>

5)整合3)和3')

<span id="totalSecond">5</span>

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

var second= document.getElementById('totalSecond').textContent;

if(navigator.appName.indexOf("Explorer")>-1){

second= document.getElementById('totalSecond').innerText;

} else{

second= document.getElementById('totalSecond').textContent;

}

setInterval("redirect()", 1000);

function redirect(){

if(second< 0){

location.href='hello.html';

} else{

if(navigator.appName.indexOf("Explorer")>-1){

document.getElementById('totalSecond').innerText= second--;

} else{

document.getElementById('totalSecond').textContent= second--;

}

}

}

</script>

参考

求html登陆界面详细代码 要可以登陆,用数据库保存

上面给你的是asp的,这边给你个php的,你看下,不懂再问我

<?php

include("config.php");

session_start();

/*--------------------删除cookies记录,让cookies过期-----------------------------------*/

if($_GET["del"]=="cookies")

{

setcookie("usercookies","", time()-3600);

setcookie("pwdcookies","", time()-3600);

echo"<SCRIPT type=text/javascript>

var n= 5;

var timer= setInterval(function(){

n--;

document.getElementById('second').innerHTML= n;

if(n== 0){

clearInterval(timer);

window.location='login.php';

}

}, 1000);

</SCRIPT>删除成功<br><B class='chengse STYLE1' id=second>5</B>秒后回到首页";

exit();

}

/*------------------------如果判断已经有cookies存在,则进行自动登录操作----------------------------------*/

if($_COOKIE["usercookies"]!="" and$_COOKIE["pwdcookies"]!="")

{

$username=$_POST["username"];

$userpassword=$_POST["userpassword"];

$sql=mysql_query("select* from user where username='$username' and userpassword='$userpassword'");

$rs=mysql_fetch_array($sql);

echo"自动跳转成功";

//exit();

}

/*----------------------------点击登录按钮后的动作act=login----------------------------------*/

if($_GET["act"]=="login")

{

/*------------------判断获取的验证码是否一致-------------------------*/

/*if(strtoupper($_SESSION["vcode"])!=strtoupper($_POST["Code"]))

{

echo("<script type='text/javascript'> alert('对不起,验证码错误!');location.href='javascript:onclick=history.go(-1)';</script>");

exit();

}*/

/*------------------------点击登录按钮后如果判断已经有cookies存在,则进行自动登录操作----------------------------------*/

if($_COOKIE["usercookies"]!="" and$_COOKIE["pwdcookies"]!="")

{

$username=$_POST["username"];

$userpassword=$_POST["userpassword"];

$sql=mysql_query("select* from user where username='$username' and userpassword='$userpassword'");

$rs=mysql_fetch_array($sql);

if($_POST["username"]==$rs["username"] and$_POST["userpassword"]==$rs["userpassword"])

{

echo"<script type='text/javascript'> alert('存在cookies登录跳转成功!');location.href='javascript:onclick=history.go(-1)';</script>";

exit();

}

else

{

echo"<script type='text/javascript'> alert('存在cookies登录跳转失败!');location.href='javascript:onclick=history.go(-1)';</script>";

exit();

}

exit();

}

/*-------------------点击登录后判断cookies不存在则进行登录比较用户名密码------------------------------*/

$username=$_POST["username"];

$userpassword=md5($_POST["userpassword"]);

$sql=mysql_query("select* from user where username='$username' and userpassword='$userpassword'");

if($rs=mysql_fetch_array($sql))

{

/*---------------------用户名密码判断正确,写入cookies动作,同时进行跳转------------------------------------*/

setcookie("usercookies",$_POST["username"], time()+3600*48);

setcookie("pwdcookies", md5($_POST["userpassword"]), time()+3600*24);

header('Location: ;);

exit();

}

else

{

/*-------------------判断用户名密码错误,弹出错误提示---------------------------*/

echo"<script type='text/javascript'> alert('用户名或密码错误,请重新输入!');location.href='javascript:onclick=history.go(-1)';</script>";

exit();

}

}

/*

$user_IP=$_SERVER["REMOTE_ADDR"];//获取访问者IP

$file_name=date('Y-m-d').'.txt';//以当前的日期建立txt文件

$file=fopen($file_name,"a+");//如果存在该文件就打开,如果不存在就创建

fwrite($file,$user_IP.'--'.date('Y-m-d H:i:s')."\r\n");//将访问者IP及当前时刻写到文件最后,\r\n在文档最后换行

fclose($file);//关闭文件

*/

?>

<!DOCTYPE html PUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""">

<html xmlns="">

<head>

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

<title>COOKIES判断是否自动登录</title>

</head>

<body>

<form action="?act=login" method="post">

<input name="username" type="text" id="username" value="<?php if($_COOKIE["usercookies"]!=""){echo$_COOKIE["usercookies"];}?>"/>

<input name="userpassword" type="password" id="userpassword" value="<?php if($_COOKIE["pwdcookies"]!=""){echo$_COOKIE["pwdcookies"];}?>"/>

<!--<img src="yanzhengma_class.php" title="看不清楚?请点击刷新验证码" onClick="this.src='yanzhengma_class.php?t='+(new Date().getTime());" height="20px;"><input name="Code" type="text" id="Code" value=""/>-->

<input name="" type="submit"/>

</form>

<a rel="external nofollow" href="?del=cookies">删除cookies</a>

</body>

</html>

求QQ网页自动登录代码

源代码如下:

Dim WshShell, QQPath, QQselect

QQPath="c:\Progra~1\Tencent\QQ\CoralQQ.exe"

Set

WshShell=WScript.CreateObject("WScript.Shell")

WshShell.Run

QQPath

WScript.Sleep 2000

WshShell.AppActivate"QQ登录"

WshShell.SendKeys

"+{TAB}"

WshShell.SendKeys"123456789"

WScript.Sleep 200

WshShell.SendKeys

"{TAB}"

WshShell.SendKeys"123456789"

WScript.Sleep 200

WshShell.SendKeys

"{ENTER}"

复制以上代码并保存为“*.VBS”,并运行便可以了。另外因为在命令行下,只支持8位字符长度的文件名,所以像“ProgramFiles”的这种文件名就要改写成“Progra~1”。如果想同时登陆多个QQ,只需再增加下面那样的代码就可以了.红色为QQ.exe所在硬盘的路径,蓝色改为QQ号码,绿色改为此QQ号码的密码。

WScript.Sleep 2000

QQPath="D:\Progra~1\Tencent\QQ\CoralQQ.exe"'QQ所在路径

Set

WshShell=WScript.CreateObject("WScript.Shell")

WshShell.Run

QQPath

WScript.Sleep 2000

WshShell.AppActivate

"QQ登录1"

WshShell.SendKeys"+{TAB}"

WshShell.SendKeys"123456789"

WScript.Sleep 200

WshShell.SendKeys

"{TAB}"

WshShell.SendKeys"123456789"

WScript.Sleep 200

WshShell.SendKeys

"{ENTER}"

html网页登录界面代码和完整html网页代码的问题分享结束啦,以上的文章解决了您的问题吗?欢迎您下次再来哦!

matlab函数大全常用 matlab求和函数j2ee?j2ee过时了吗