html登录页面代码(网上商城系统登录页面html代码怎么写)

本文目录
网上商城系统登录页面html代码怎么写
《div》
《div》
《lable》账号《/lable》
《input placeholder="输入你的账号"》
《/div》
《div》
《lable》密码《/lable》
《input placeholder="输入你的密码"》
《/div》
《button》登录《/botton》
《/div》
结构大致这样 样式自己调了
求html登陆界面详细代码 要可以登陆,用数据库保存
上面给你的是asp的,这边给你个php的,你看下,不懂再问我
《?php
include("config.php");
session_start();
/*--------------------删除cookies记录,让cookies过期-----------------------------------*/
if($_GET=="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!="")
{
$username=$_POST;
$userpassword=$_POST;
$sql=mysql_query("select * from user where username=’$username’ and userpassword=’$userpassword’");
$rs=mysql_fetch_array($sql);
echo"自动跳转成功";
//exit();
}
/*----------------------------点击登录按钮后的动作act=login----------------------------------*/
if($_GET=="login")
{
/*------------------判断获取的验证码是否一致-------------------------*/
/*if(strtoupper($_SESSION))
{
echo("《script type=’text/javascript’》 alert(’对不起,验证码错误!’);location.href=’javascript:onclick=history.go(-1)’;《/script》");
exit();
}*/
/*------------------------点击登录按钮后如果判断已经有cookies存在,则进行自动登录操作----------------------------------*/
if($_COOKIE!="")
{
$username=$_POST;
$userpassword=$_POST;
$sql=mysql_query("select * from user where username=’$username’ and userpassword=’$userpassword’");
$rs=mysql_fetch_array($sql);
if($_POST)
{
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;
$userpassword=md5($_POST);
$sql=mysql_query("select * from user where username=’$username’ and userpassword=’$userpassword’");
if($rs=mysql_fetch_array($sql))
{
/*---------------------用户名密码判断正确,写入cookies动作,同时进行跳转------------------------------------*/
setcookie("usercookies", $_POST, time()+3600*48);
setcookie("pwdcookies", md5($_POST), time()+3600*24);
header(’Location: echo "《script type=’text/javascript’》 alert(’用户名或密码错误,请重新输入!’);location.href=’javascript:onclick=history.go(-1)’;《/script》";
exit();
}
}
/*
$user_IP = $_SERVER;//获取访问者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" "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=gb2312" /》
《title》COOKIES判断是否自动登录《/title》
《/head》
《body》
《form action="?act=login" method="post"》
《input name="username" type="text" id="username" value="《?php if($_COOKIE;}?》" /》
《input name="userpassword" type="password" id="userpassword" value="《?php if($_COOKIE;}?》"/》
《!--《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 href="?del=cookies"》删除cookies《/a》
《/body》
《/html》

本文相关文章:
web静态网页模板(.net C#怎样生成静态页面,不用模板的方式是怎么样的)
2026年5月16日 00:45
个人信息页面设计(如何把自己的名字添加到自己的微信页面上去)
2026年5月15日 22:36
红杏入口自动跳转ncnc44(为什么百度的页面总是自动跳转到登陆的那一页)
2026年5月15日 03:50
滁州网站建设(响应式页面设计要多少钱,html5网站制作机构)
2026年5月14日 22:30
动漫网站设计模板(跪求Dw cs6 网页设计作品,要交作业,急啊,主题最好是介绍电视剧,动漫,书之类的、2~4个页面)
2026年5月14日 14:50
更多文章:
全屋定制十大名牌有哪些(全屋定制十大品牌有哪些性价比最高的是什么品牌)
2026年4月25日 23:38
黑龙江seo技巧软件新手入门教程:黑龙江seo技巧软件新手如何快速上手
2026年6月14日 10:06















