用JavaScript为你的网站加密

时间:2010-03-24 18:39:48  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:">  <!--  flag=0  flag2=0  -->  </script>  <script LANGUAGE="JavaScript" SRC="password.txt"> //密码表文件  </script>  <script LANGUAGE="JavaScript" SRC="password1.txt"> //密码验证文件  </script>  ...
  正文:我们经常会遇到一些必须输入用户名和密码才能进入的网站。其实我们也可以对自己的网站页面进行简单的加密,具体操作请看下文:

  第一步:创建密码登录页
  将如下代码加入HTML的〈BODY〉区:
<script LANGUAGE="JavaScript">
  <!--
  flag=0
  flag2=0
  -->
  </script>
  <script LANGUAGE="JavaScript" SRC="password.txt"> //密码表文件
  </script>
  <script LANGUAGE="JavaScript" SRC="password1.txt"> //密码验证文件
  </script>
  <h1 align="center">Login</h1>
  <script LANGUAGE="JavaScript">
  <!--
  function main()
  {
  member = document.all.username.value
  pass = document.all.password.value
  encryption()
  password()
  }
  -->
  </script>
  <p>输入用户名: <input TYPE="TEXT" ID="username" size="20"><br>
  请输入密码: <input TYPE="PASSWORD" ID="password" size="20">
  <input TYPE="BUTTON" ID="button" onclick="main()" value="Enter!" align="center"></p>

  第二步:分别编辑文件1(password.txt)和文件2(password1.txt),适合你自己的页面情况,主要是:密码设定和用户名设定。
文件1:password.txt
一张密码表,一看就懂,没有什么难度。可以自由设计,注意大小写的区别。
function encryption()
  {
  mm = "Z"
  k = "j"
  b = "p"
  mmmm = "&"
  ccc = "6"
  l = "i"
  c = "q"
  m = "s"
  abcd = "m"
  o = "n"
  u = "z"
  e = "d"
  gg = "U"
  p = "u"
  jj = "O"
  v = "a"
  j = "y"
  x = "c"
  r = "n"
  bb = "D"
  cc = "K"
  z = "w"
  a = "x"
  ee = "G"
  n = "f"
  ff = "T"
  i = "g"
  w = "r"
  ii = "V"
  kk = "I"
  q = "o"
  oooo = ")"
  d = "e"
  nn = "E"
  oo = "P"
  pp = "X"
  t = "h"
  s = "v"
  rr = "S"
  ss = "L"
  tt = "R"
  uu = "A"
  h = "k"
  vv = "C"
  ww = "M"
  aa = "Y"
  xx = "Q"
  hh = "B"
  yy = "H"
  zz = "W"
  y = "t"
  qq = "J"
  aaa = "8"
  bbb = "0"
  f = "b"
  ddd = "9"
  eee = " "
  fff = "3"
  dd = "N"
  ggg = "4"
  hhh = "1"
  iii = "2"
  jjj = "7"
  kkk = "5"
  lll = "."
  mmm = ","
  nnn = ";"
  ooo = ":"
  ppp = "'"
  qqq = "<"
  rrr = ">"
  sss = "-"
  ttt = "_"
  uuu = "="
  vvv = "/"
  www = "?"
  xxx = "`"
  yyy = "~"
  zzz = "*"
  aaaa = "+"
  bbbb = "["
  cccc = "]"
  g = "l"
  dddd = "{"
  eeee = "}"
"用JavaScript为你的网站加密"由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Programming/JavaScript/13340.html


关键字:

关于《用JavaScript为你的网站加密》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td