我的PHP函数在外部服务器上不工作

我的PHP函数在外部服务器上不工作,php,function,session,Php,Function,Session,我在我的本地主机“xampp”上编写了网站代码,一切都运行得非常好 然后我试着在一个免费的主机上测试它,但是所有的功能和会话都不起作用 例如,login.php未登录,$\会话及其上的函数不工作 <?php include ('core/coding/core.php'); check_log_in(); include ('panels/header.php'); ?> <title>Login</title> <div class="contain

我在我的本地主机“xampp”上编写了网站代码,一切都运行得非常好

然后我试着在一个免费的主机上测试它,但是所有的功能和会话都不起作用

例如,login.php未登录,$\会话及其上的函数不工作

<?php
include ('core/coding/core.php');
check_log_in();
include ('panels/header.php');

?>
<title>Login</title>
<div class="container">
  <div class="row">
    <?php
    if (empty($_POST) === false) {
      $username = $_POST['username'];
      $password = $_POST['password'];
      if (empty($username) === true or empty($password) === true) {
        $errors[] = 'Enter all Fields';
      }
      else
        if (user_exists($username) === false) {
          $errors[] = 'Username not found.';
          $errors[] = 'Do You want to ' . '<a href="register.php">register</a>' . ' ?';
          $errors[] = 'Note That Username/Password are Case Senstive';
        }
        else
          if (user_active($username) === false) {
            $errors[] = 'Account not Activated';
          }
          else
            if (strlen($password) > 32) {
              $errors[] = 'Password is too long';
            }
            else {
              $login = login($username, $password);
              if ($login === false) {
                $errors[] = 'Incorrect Information';
              }
              else {
                $_SESSION['user_id'] = $login;
                echo '<META HTTP-EQUIV="Refresh" Content="0; URL=' . D_TEMPLATE . '">';
                die();
              }
      }
    }
    if (!empty($errors)) {
      echo output_errors($errors);
    }
    ?>

    <div class="col-md-6 col-md-offset-3 login">
        <center><h2>Login</h2></center>
        <form class="form-horizontal" action="" method="post">
          <div class="form-group">
            <label  class="col-sm-2 control-label">Username</label>
            <div class="col-sm-10">
              <input type="text" class="form-control" placeholder="Username" name="username" >
            </div>
          </div>
          <div class="form-group">
            <label for="inputPassword3" class="col-sm-2 control-label">Password</label>
            <div class="col-sm-10">
              <input type="password" class="form-control" id="inputPassword3" placeholder="Password" name="password">
            </div>
          </div>
          <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
              <button type="submit" class="btn btn-default">login</button>
            </div>
          </div>
        </form>
    </div>
  </div>
</div>

登录
登录
用户名
密码
登录
core.php

<?php
session_start();
error_reporting();
ob_start();
include ('connect.php');
include ('general.php');
include ('function.php');
define('D_TEMPLATE', 'http://localhost/site');
$errors = array();
?>

register.php也没有任何函数可以工作

我尝试了3个不同的免费主机现在和相同的问题。。那么问题在哪里呢

希望你能帮我我睡不着:(

谢谢

编辑:

解决方案:功能在xampp上使用旧本地主机的连接 当我修好它时,它工作得很好


感谢大家

在两台服务器上运行php_info();并查找加载的模块/库中的差异。

如果您可以使用php_info()创建一个php页面,那就太好了在里面。我需要检查什么?!你的xampp和免费主机之间加载的模块/库之间的差异。那么…我可以添加这个作为答案吗?