editsite.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. include_once('tpl/header.php');
  3. include_once('functions/medoo.php');
  4. include_once("config.php");
  5. $host = $_SERVER['HTTP_HOST'].$_SERVER["PHP_SELF"];
  6. $host = "http://".str_replace("editsite.php","",$host)."functions/method.php?type=select_ssl";
  7. $selectssl = file_get_contents($host);
  8. $database = new medoo([
  9. 'database_type' => 'sqlite',
  10. 'database_file' => 'data/nssl.db3']);
  11. $siteid = $_GET['siteid'];
  12. $siteinfo = $database->get("s_site",["domain","sslid","https"],["id" => $siteid]);
  13. ?>
  14. <div class="layui-container" style = "margin-top:40px;">
  15. <div class="layui-row">
  16. <div class="layui-col-lg10 layui-col-md-offset1">
  17. <!--提示-->
  18. <div>
  19. <pre class="layui-code">请在下方填写需要启用SSL的站点,域名不需要包含http://,如果您的网站调用了http链接,强制HTTPS会导致网站异常。</pre>
  20. </div>
  21. <!--提示END-->
  22. <!--表单-->
  23. <div id="" style = "margin-top:40px;">
  24. <form class="layui-form" action="">
  25. <div class="layui-form-item">
  26. <label class="layui-form-label">域名</label>
  27. <div class="layui-input-block">
  28. <input type="text" id="domain" readonly="readonly" required lay-verify="required" placeholder="输入要启用SSL的域名" autocomplete="off" class="layui-input" value = "<?php echo $siteinfo['domain']; ?>">
  29. </div>
  30. </div>
  31. <div class="layui-form-item">
  32. <label class="layui-form-label">选择证书</label>
  33. <div class="layui-input-block">
  34. <select id = "cert" lay-verify="required">
  35. <?php echo $selectssl; ?>
  36. </select>
  37. </div>
  38. </div>
  39. <div class="layui-form-item">
  40. <label class="layui-form-label">强制HTTPS</label>
  41. <div class="layui-input-block">
  42. <input type="checkbox" name="switch" lay-skin="switch" id = "https">
  43. </div>
  44. </div>
  45. </form>
  46. <div class="layui-form-item">
  47. <div class="layui-input-block">
  48. <button class="layui-btn" lay-filter="formDemo" id = "btn">保存</button>
  49. <!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
  50. </div>
  51. </div>
  52. </div>
  53. <!--表单END-->
  54. </div>
  55. </div>
  56. </div>
  57. <?php
  58. include_once('tpl/footer.php');
  59. ?>
  60. <script>
  61. layui.use(['form','element'], function(){
  62. var form = layui.form;
  63. //监听提交
  64. });
  65. </script>