好的,所以我的PHP至少说可怕。我继承了一个应用程序,并且不得不修复7年前写过它的人的错误。当我运行的页面,没有回报,所以我检查日志来查看错误,这里是我所得到的:PHP设置全局变量的语法错误
PHP Parse error: syntax error, unexpected '=', expecting ',' or ';' in /httpdocs/cron123/purge.php on line 4
下面是代码:
<?
ob_start();
global $siteRoot = '/httpdocs/';
global $reportRoot = '/reports/';
include('billing1.php');
$date='Purge report for: ' .date('M d, Y \a\t g:i a'); ?>
<html>
<head><title><?=$date?></title></head>
<body>
<?php
$account = new billing();
$ftresult = $account->purge();
new dBug($ftresult);
echo "successfully wrote";
?>
</body>
<?
$filename = "purge_report_" . date('y.m.d_\a\t_g_i_a') . ".html";
$loc = $reportRoot . 'purge_reports/';
$f = $loc . $filename;
$fp = @fopen($f, 'w');
@fwrite($fp, ob_get_contents());
@fclose($fp);
ob_end_flush();
?>