Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/61.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php ssl证书导致一个文件不工作_Php_Mysql_Http_Ssl_Https - Fatal编程技术网

Php ssl证书导致一个文件不工作

Php ssl证书导致一个文件不工作,php,mysql,http,ssl,https,Php,Mysql,Http,Ssl,Https,最近我获得了SSl证书并安装了它,以后的一切似乎都很好,但有一个文件(index1.php)不能正常工作,该文件只能在http上工作,不能在https上工作 选项卡注册(#Signup)不仅显示(#sigin)正在工作(在使用的情况下),而且在使用时工作正常(http://.. )我没有发现任何错误。这是我的php文件: <?php /* Main page with two forms: sign up and log in */ require 'db.php'; session_st

最近我获得了SSl证书并安装了它,以后的一切似乎都很好,但有一个文件(index1.php)不能正常工作,该文件只能在http上工作,不能在https上工作 选项卡注册(#Signup)不仅显示(#sigin)正在工作(在使用的情况下),而且在使用时工作正常(http://.. )我没有发现任何错误。这是我的php文件:

<?php /* Main page with two forms: sign up and log in */
require 'db.php';
session_start();?>
<!DOCTYPE html><html><head>  <title>Sign-Up/Login Form</title>
<?php include 'css/css.html'; ?></head>
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
if (isset($_POST['login'])) { //user logging in

    require 'login.php';

}

elseif (isset($_POST['register'])) { //user registering

    require 'register.php'; }}?>
<body>  <div class="form">

  <ul class="tab-group">
    <li class="tab"><a href="#signup">Sign Up</a></li>
    <li class="tab active"><a href="#login">Log In</a></li>
  </ul>

  <div class="tab-content">

     <div id="login">   
      <h1>Welcome Back!</h1>

      <form action="index1.php" method="post" autocomplete="off">

        <div class="field-wrap">
        <label>
          Email Address<span class="req">*</span>
        </label>
        <input type="email" required autocomplete="off" name="email"/>
      </div>

      <div class="field-wrap">
        <label>
          Password<span class="req">*</span>
        </label>
        <input type="password" required autocomplete="off" name="password"/>
      </div>

      <p class="forgot"><a href="forgot.php">Forgot Password?</a></p>

      <button class="button button-block" name="login" />Log In</button>

      </form>

    </div>

    <div id="signup">   
      <h1>Sign Up for Free</h1>

      <form action="index1.php" method="post" autocomplete="off">

      <div class="top-row">
        <div class="field-wrap">
          <label>
            First Name<span class="req">*</span>
          </label>
          <input type="text" required autocomplete="off" name='firstname' />
        </div>

        <div class="field-wrap">
          <label>
            Last Name<span class="req">*</span>
          </label>
          <input type="text"required autocomplete="off" name='lastname' />
        </div>
    </div>


    <div class="top-row">
        <div class="field-wrap">
          <label>
            City <span class="req">*</span>
          </label>
          <input type="text" required autocomplete="off" name='City' />
        </div>

        <div class="field-wrap">
          <label>
            Postal<span class="req">*</span>
          </label>
          <input type="text"required autocomplete="off" name='Postal' />
        </div>
    </div>


    <div class="top-row">
        <div class="field-wrap">
          <label>
            Street<span class="req">*</span>
          </label>
          <input type="text" required autocomplete="off" name='Street' />
        </div>

        <div class="field-wrap">
          <label>
            buildingNo<span class="req">*</span>
          </label>
          <input type="text"required autocomplete="off" name='buildingNo' />
        </div>
    </div>


    <div class="top-row">
        <div class="field-wrap">
          <label>
            phone<span class="req">*</span>
          </label>
          <input type="text" required autocomplete="off" name='phone' />
        </div>

        <div class="field-wrap">
          <label>
            Room (if any)
          </label>
          <input type="text"notrequired autocomplete="off" name='noteadress' />
        </div>
    </div>

      <div class="field-wrap">
        <label>
          Email Address<span class="req">*</span>
        </label>
        <input type="email"required autocomplete="off" name='email' />
      </div>

      <div class="field-wrap">
        <label>
          Set A Password<span class="req">*</span>
        </label>
        <input type="password"required autocomplete="off" name='password'/>

      </div>
          <div class="field-wrap">
       <h3 style="color:green"> By clicking Register, you agree to our Terms and that you have read our <span><a  href="../../../../forms/terms-and-conditions/index.html">Data Use Policy</a></span>, including our Cookie Use</h3>
      </div>

      <button type="submit" class="button button-block" name="register" />Register</button>

      </form>

    </div>  

  </div><!-- tab-content -->

</div> <!-- /form -->
  <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>

    <script src="js/index.js"></script>

</body>
</html>

注册/登入表格
欢迎回来! 电子邮件地址* 密码*

登录 免费报名 名字* 姓* 城市* 邮政的* 街头* 大楼号* 电话* 房间(如有) 电子邮件地址* 设置密码* 单击“注册”,即表示您同意我们的条款,并且您已经阅读了我们的条款,包括Cookie的使用 登记
可能会尝试更改:

<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>

致:



如果简单地将http更改为https不起作用,您需要找到链接的https版本。

一些合理的代码缩进将是一个好主意。它帮助我们阅读代码,更重要的是,它将帮助您为自己的利益调试代码。您可能会被要求在几周/几个月内修改此代码,最后您将感谢我。
更改
”http://cdnjs.cloudflare.com...“
”//cdnjs.cloudflare.com…”
在这两种情况下都可以工作。正如@Syscall和Magnus Eriksson所说,您的问题可能是由于内容混合造成的。当页面是来自https的服务器,但是来自http的静态文件(jquery javascript文件)没有加载,并且由于缺少jquery,您的页面内锚无法工作。这是一篇关于混合内容的好文章。通过将脚本从http更改为httpsnow,上面的表单将注册信息输入Mysql,问题得到了解决。如果我想使用选项从下拉列表中选择城市和街道,并将该选项弹出到Mysql中的表中,我该怎么做?我不太明白这个问题。最好将此问题标记为已回答,然后针对您的问题提出另一个问题。
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>