login.js
来自「PHP免费网摘程序 详细说明: 安装说明: 1、把文件上穿上去以后」· JavaScript 代码 · 共 43 行
JS
43 行
function getcookieval(offset) {
var endstr = document.cookie.indexOf(";",offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape (document.cookie.substring(offset,endstr));
}
function getcookie(name) {
var arg = name + '=';
var alen = arg.length;
var clen = document.cookie.length;
var j = 0;
while (j< clen) {
var k = j + alen;
if(document.cookie.substring(j,k) == arg) return getcookieval(k);
j = document.cookie.indexOf("",j)+1;
if (j ==0 ) break;
}
return null;
}
var username = getcookie("userid")
var usertype = getcookie("usertype")
if ((username != null) & (username != ""))
{
document.write("欢迎您:<B>");
document.write(getcookie("userid"));
document.write("</B> | ");
document.write("<a href='/zhai/logout.php'>注销</a> | ");
document.write("<a href='/zhai/mysetup.php'>修改资料</a> | ");
document.write("<a href='/zhai/icollect.php' title='添加新网摘'><font color=red>添加网摘</font></a> | ");
document.write("<a href='/zhai/myzhai.php' title='管理我的网摘'><font color=red>我的网摘</font></a> | ");
document.write("<a href='/zhai/myallpic.php' title='管理我的网摘'><font color=red>我的图片</font></a> | ");
document.write("<a href='/zhai/mypic.php' title='管理我的网摘'><font color=red>已审图片</font></a> | ");
}
else
{
document.write('用户登陆:用户名<input id="userName" name="userid" /> 密码<input id="password" name="psw" type="password" /> <input id="submit" name="submit" type="submit" value="登录" />');
document.write("<a href='/zhai/reg.php'>免费注册</a> ");
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?