所以我找到了一个网络文件来学习,但遗憾的是没有教程如何安装它们。无论如何,我不是一个完全的新手,但仍然不明白出了什么问题。我已经安装了 xampp,将所有文件放入 htdocs,我上传了数据库,更改了这些文件中的数据库登录名、密码、名称,但在尝试访问网站时遇到此错误:
这是index.php文件
<?
error_reporting(E_ALL);
ini_set('display_errors', '0');
ini_set('memory_limit', '64M');
date_default_timezone_set('Europe/Vilnius');
if(substr(StrToLower($_SERVER["HTTP_HOST"]), 0, 4) != 'www.') {
$rto = 'http://www.' . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
header('Location: '. $rto);
}
require_once 'class/mysql.class.php';
require_once 'class/users.class.php';
require_once 'functions.php';
require_once 'Page.php';
if(isset($_POST["submit"])) {
user()->Join($_POST["username"], $_POST["password"]);
header("location: /");
}
if(!empty($_GET["psl"])) {
$id = explode('/', $_GET['psl']);
} else {
$id = array("start");
}
$_page = array_shift($id);
$page = new Page($_page);
echo $page->build($id);
?>
最佳答案
将 php 打开标记更改为
< ? to < ?php
或者确保 php.ini 中的 php Short_open_tag 设置为 true
关于php - 当我运行此示例时,浏览器上显示意外的奇怪代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55491481/