12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- include_once('tpl/header.php');
- $host = $_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"];
- $host = "http://".str_replace("installssl.php","",$host)."functions/method.php?type=select_ssl";
-
- $selectssl = file_get_contents($host);
- ?>
- <div class="layui-container" style = "margin-top:40px;">
- <div class="layui-row">
- <div class="layui-col-lg10 layui-col-md-offset1">
- <!--提示-->
- <div>
- <pre class="layui-code">请在下方填写需要启用SSL的站点,域名不需要包含http://,如果您的网站调用了http链接,强制HTTPS会导致网站异常。</pre>
- </div>
- <!--提示END-->
- <!--表单-->
- <div id="" style = "margin-top:40px;">
- <form class="layui-form" action="">
- <div class="layui-form-item">
- <label class="layui-form-label">域名</label>
- <div class="layui-input-block">
- <input type="text" id="domain" required lay-verify="required" placeholder="输入要启用SSL的域名" autocomplete="off" class="layui-input">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">选择证书</label>
- <div class="layui-input-block">
- <select id = "cert" lay-verify="required">
- <?php echo $selectssl; ?>
- </select>
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">强制HTTPS</label>
- <div class="layui-input-block">
- <input type="checkbox" name="switch" lay-skin="switch" id = "https">
- </div>
- </div>
- </form>
- <div class="layui-form-item">
- <div class="layui-input-block">
- <button class="layui-btn" lay-filter="formDemo" id = "btn">保存</button>
- <!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
- </div>
- </div>
- </div>
- <!--表单END-->
- </div>
- </div>
- </div>
- <script>
- layui.use(['form','element'], function(){
- var form = layui.form;
- });
- $(document).ready(function(){
- //$.get("./functions/method.php?type=select_ssl",function(data,status){
- // $("#cert").append(data);
- //});
- $("title").empty();
- $("title").append("部署SSL证书");
- $("#btn").click(function(){
- //alert('dsds');
- var domain = $("#domain").val();
- var sslid = $("#cert").val();
- //var https = $("#https").val();
- //是否强制SSL
- if ($("#https").get(0).checked) {
- var https = 1;
- }
- else {
- var https = 0;
- }
- $.post("./functions/method.php?type=add_site",{domain:domain,sslid:sslid,https:https},function(data,status){
- layer.open({
- title:'温馨提示',
- content:data,
- time:2000
- });
- });
- });
- });
- </script>
- <?php
- include_once('tpl/footer.php');
- ?>
|