上傳後,此代碼正常工作本地(xampp)我收到解析錯誤:語法錯誤,意外的T_STRING,但似乎無法找出什麼是問題。解析錯誤:語法錯誤,意外的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;
感謝。
其中write_logfile在代碼中定義.. ???你需要添加write_logfile標籤.. – 2013-02-23 05:15:14
我沒有意識到人們實際上使用了'goto',因爲它被引入 – 2013-02-23 05:16:02
對不起,編輯了主帖。 – 2013-02-23 05:16:41