欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

web服务器,验证码,Xftp使用方法

程序员文章站 2022-06-22 12:58:39
IIS操作步骤 直接装的wamp 腾讯云主机控制台 安全组里可以配置要开放的端口 关闭防火墙 (C:\wamp\bin\apache\Apache2.4.4) 打开httpd.conf文件 require all denied 改成: wamp用localhost可以访问,用公网ip无法访问 用外网 ......

web服务器,验证码,Xftp使用方法

iis操作步骤

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

直接装的wamp
腾讯云主机控制台
安全组里可以配置要开放的端口
关闭防火墙

(c:\wamp\bin\apache\apache2.4.4)
打开httpd.conf文件
require all denied
改成:
web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

wamp用localhost可以访问,用公网ip无法访问
用外网访问提示403 forbbiden

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

最好关闭防火墙

web服务器,验证码,Xftp使用方法

打开http://localhost

web服务器,验证码,Xftp使用方法

建立web服务器
将网站挂在8080端口上

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

在iis中可以选择“添加虚拟目录”和“添加应用程序”两种方法

web服务器,验证码,Xftp使用方法

选择一个网站或者虚拟目录

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

验证码功能

<!doctype html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="x-ua-compatible" content="ie=edge">

  <title>前端验证码功能</title>
  <style>
    *{
      margin: 0;
      padding: 0;
    }
    body{
      background: rgba(0, 0, 0, .1);
      /* background: #061227; */
    }
    form{
      width: 600px;
      margin: 100px auto;
    }
    .box{
      height: 40px;
      line-height: 40px;
    }
    .tip{
      float: left;
    }
    input{
      float: left;
      width: 200px;
      height: 30px;
      padding: 3px 10px;
      line-height: 30px;
    }
    #identify{
      float: left;
      width: 100px;
      height: 40px;
      line-height: 40px;
      font-weight: bold;
      text-align: center;
      letter-spacing: 2px;
      background: #365c64;
      color: #fff;
      border-radius: 5px;
      margin: 0 10px;
    }
    .btn{
      margin: 25px auto;
    }
    .btn button{
      width: 200px;
      height: 36px;
      line-height: 36px;
      background: #409eff;
      border-radius: 5px;
      border: 0;
      color: #fff;
    }
  </style>
</head>

<body>
  <form action="">
    <div class="box">
      <span class="tip">验证码:</span>
      <input type="text" id="text" value="" placeholder="请输入验证码" autocomplete="off">
      <span id="identify" onclick="generatedcode()"></span>
      <a href="javascript:void(0)" onclick="generatedcode()">看不清,换一张</a>
    </div>
    <div class="btn"><button onclick="checkcode()">验证</button></div>
  </form>
</body>
<script>
  generatedcode();
  // 随机生成验证码
    function generatedcode() {
      var code1 = "";//生成的验证码 
      var array = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
      for (let i = 0; i < 4; i++) {
        var index = math.floor(math.random() * 36);//随机0-35
        code1 += array[index];
        document.getelementbyid("identify").innerhtml = code1;
      }
      console.log("二维码是:",code1)
    };
    // 验证用户输入
    function checkcode() {
      var code2 = document.getelementbyid("identify").innerhtml;//获取当前生成的验证码
      code2 = code2.touppercase();

      var code3 = document.getelementbyid("text").value; //客户输入的验证码
      code3 = code3.touppercase();//把客户输入的验证码转换为大写
      console.log("生成的二维码是:"+ code2 +"\n用户输入的验证码是:"+ code3)

      if (code2 === code3) {
        alert("恭喜验证成功");
        // window.open('http://www.baidu.com');
      } else {
        alert("输入的验证码不正确");
        code3 = "";//清空用户输入
      }
    }
</script>
</html>

wampserver
腾讯云服务器
windows server 2012 r2,wampserver 2.4。

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

ftp是 file transfer protocol文件传输协议的缩写,用来在两台计算机之间互相传送文件。

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

点击download下方的free license菜单

web服务器,验证码,Xftp使用方法

web服务器,验证码,Xftp使用方法

结言

好了,欢迎在留言区留言,与大家分享你的经验和心得。

感谢你学习今天的内容,如果你觉得这篇文章对你有帮助的话,也欢迎把它分享给更多的朋友,感谢。