unparseble T_VARIABLE error
Posted: Wed Dec 23, 2009 4:09 am
Hello
I'm having some trouble with a bit of code. Im getting the following error in my logs and I can't debug it:
I've looked at loads of posts I found from google about this error and it seems that it's mostly caused by missing ; (semi-colon) or other symbol, but I have checked this over and over and i'm.
I knda hoped someone would be able to take a look and see if the error is more obvious to another pair of eyes. Here is the entire file:
When I look at line 26 in my editor, it appears the error stems from this section of the code:
I would really appreciate any advice on this. Thank, Jamie
I'm having some trouble with a bit of code. Im getting the following error in my logs and I can't debug it:
Code: Select all
PHP Parse error: syntax error, unexpected T_VARIABLE in /path/to/file/on/server/createpage.inc on line 26I knda hoped someone would be able to take a look and see if the error is more obvious to another pair of eyes. Here is the entire file:
Code: Select all
<?
function CreatePage($input)
{
list($text) = $input;
$result_dir = $Config['results_dir'];
$tmpfname = tempnam ("$result_dir/", "");
# I can't remember why I tacked on 2 random digits.
$outbase = $tmpfname . rand(10, 99);
$outfile = $outbase . ".html";
$ipAddr = $_SERVER["REMOTE_ADDR"];
$pasteID = basename($outbase);
$token = sha1($pasteID . $ipAddr . $Config['token_salt']);
# There is probably a better way to do this. tempnam() creates the
# temporary file in the results directory, but we then need to strip
# this off the front of the filename to make a shorter url.
$rawout = $outfile;
$rawout = preg_replace("/$result_dir\//", "", $rawout);
if ($Config['short_results_path']) {
$urlbase = $Config['short_results_path'];
} else {
$urlbase = $Config['site_domain'] . $Config['site_path'] . '/' $Config['results_dir'];
}
$pasteUrl = $urlbase . $rawout;
$text = preg_replace("/=\{this-paste-url\}/", $pasteUrl, $text);
$text = preg_replace("/=\{remove-paste-url\}/", $Config['site_domain'] . $Config['site_path'] . "remove.php?p=$pasteID&t=$token", $text);
$fp = fopen($outfile, "w");
fwrite($fp, $text);
fclose($fp);
unlink($tmpfname);
return $pasteUrl;
}
?>
Code: Select all
if ($Config['short_results_path']) {
$urlbase = $Config['short_results_path'];
} else {
$urlbase = $Config['site_domain'] . $Config['site_path'] . '/' $Config['results_dir'];