我一直在尝试找到一个启用了 output_buffering 的主机,而我的主机 atm 没有启用它。想抓住他是不可能的……所以……我需要找到解决办法或者找一个新的宿主。我想在决定是否有“正确的方式”或 output_buffering 不必打开之前,我可能会问。
这是我制作的脚本,在没有 output_buffering 的情况下无法运行:
<?php
session_start();
if (isset($_SESSION['authenticated'])) {
if (isset($_GET['time']) && isset($_GET['user']) && isset($_GET['pass']) && isset($_GET['ip'])) {
require("config.php");
$currentTime = time();
$time = mysql_real_escape_string($_GET['time']);
$user = mysql_real_escape_string($_GET['user']);
$pass = mysql_real_escape_string($_GET['pass']);
$ip = mysql_real_escape_string($_GET['ip']);
mysql_query("INSERT INTO `deleted` (timeDeleted, timeLogged, username, password, ip) VALUES('$currentTime','$time','$user','$pass','$ip')") or die(/*mysql_error() . */" Error code: 1");
mysql_query("DELETE FROM `flagged` WHERE `timeLogged`='$time'") or die(/*mysql_error() . */"Error code: 2");
mysql_close($con);
include("flagged.php");
}
} else {
header("Location: index.php");
exit;
}
?>
它失败了,因为它include("flagged.php");
永远不会被包含在内,或者它可能会失败,但我只是从未见过它。
所以我的问题是:如果没有 output_buffering,我该怎么做才能让它工作?output_buffering 是坏/坏的做法吗?