上传后此代码在本地(xampp)运行良好我收到解析错误:语法错误,意外的 T_STRING,但似乎无法找出问题所在。
$user = $_GET["u"];
$order = $_GET["o"];
$fullorder = $user . $order . ".txt";
include("geoip.inc");
$ip=$_SERVER['REMOTE_ADDR'];
function loghit()
{
$user = $_GET["u"];
$order = $_GET["o"];
$fullorder = $user . $order . ".txt";
$lf_name = $fullorder;
$monthly = 0;
$monthly_path = "oldfiles";
$type = 1;
$display = 1;
$separator = "<br \>";
$log_file = dirname(__FILE__) . '/' . $lf_name;
$uIP = $_SERVER['REMOTE_ADDR'];
if (file_exists($log_file)) {
if (date('j') == 10) {
if (!file_exists($monthly_path)) {
mkdir($monthly_path);
}
$prev_name = $monthly_path . '/' . date("n-Y", strtotime("-1 month"));
if (!file_exists($prev_name)) {
copy($log_file, $prev_name);
if ($type == 0) {
$toWrite = "1";
$info = $beforeAllText . "1";
} else if ($type == 1) {
$toWrite = "1;" . $uIP . ",";
$info = $beforeUniqueText . "1";
} else if ($type == 2) {
$toWrite = "1;1;" . $uIP . ",";
$info = $beforeAllText . "1" . $separator . $beforeUniqueText . "1";
}
goto write_logfile;
}
}
write_logfile 文件位于代码下方:
write_logfile:
//Put $toWrite in log file
file_put_contents($log_file, $toWrite);
}
此行发生错误:
goto write_logfile;
提前感谢您的帮助。