首页 > 解决方案 > 如何通过localhost打开php文件?

问题描述

我是一名高中生,想学习如何编码。我正在使用 xampp、php、mySQL 和 Apache 开发一个学生管理程序。当我使用 localhost: localhost/superschool/index.html打开我的 index.html 文件时,站点地址变为localhost/superschool/index.php。这会显示以下错误消息: HTTP ERROR 500 with console message: (index):7290 crbug/1173575, non-JS module files deprecated。 我不确定为什么会这样。你能给我一个见解来解决这个问题吗?太感谢了!这是我的 index.html 和 index.php 文件供参考。

索引.html

<html>
    <head>
        <meta http-equiv="Refresh" content="0;url=index.php">
        <title>Loading ...</title>
    </head>
    <body></body>
</html>

索引.php

    error_reporting(E_ERROR | E_WARNING | E_PARSE);
    $currDir = dirname(__FILE__);
    include("{$currDir}/defaultLang.php");
    include("{$currDir}/language.php");
    include("{$currDir}/lib.php");

    $x = new DataList;
    $x->TableTitle = $Translation['homepage'];
    $tablesPerRow = 2;
    $arrTables = getTableList();

    // according to provided GET parameters, either log out, show login form (possibly with a failed login message), or show homepage
    if(isset($_GET['signOut'])){
        logOutUser();
        redirect("index.php?signIn=1");
    }elseif(isset($_GET['loginFailed']) || isset($_GET['signIn'])){
        if(!headers_sent() && isset($_GET['loginFailed'])) header('HTTP/1.0 403 Forbidden');
        include("{$currDir}/login.php");
    }else{
        include("{$currDir}/main.php");
    }

标签: phphtmlmysqlapachexampp

解决方案


推荐阅读