Hey all,
Well this is by far one of the weirdest errors i've ever been stumped on in php.
Here's my page:
Now the problem is on line 35, at the end:
For example, change this:
Well this is by far one of the weirdest errors i've ever been stumped on in php.
Here's my page:
PHP:
// include functions
require_once("include/functions.php");
// connect to database
db();
// get web settings
$settings=websiteSettings();
$template1 = new page("templates/" . $settings[template] . "/playgame.html");
if($HTTP_GET_VARS[id]!="")
{
$gameInfo=getGameInfo($HTTP_GET_VARS[id]);
}
else
{
$gameInfo=getGameInfo(0,$HTTP_GET_VARS[game]);
}
$type=strtolower(ereg_replace("^.+\\.([^.]+)$", "\\1",$gameInfo[filename]));
switch($type)
{
case "swf":
$type="flash";
break;
}
$embedInfo = new page("include/embed/" . $type . ".txt");
$embedInfo->replaceTags(array("{WIDTH}" => $gameInfo[width], "{HEIGHT}" => $gameInfo[width], "{FILEN}" => "media/games/" . $gameInfo[filename]));
$template1->replaceTags(array("{TITLE}" => $gameInfo[title], "{GAME}" => $embedInfo->output($settings[template], "false")));
// create page wrapper (header, footer)
$templateWrapper = new page("templates/" . $settings[template] . "/wrapper.html");
// replace tags with appropriate variables and with main page
$templateWrapper->replaceTags(array("{TITLE}" => $settings[title], "{DESCRIPTION}" => $settings[description], "{KEYWORDS}" => $settings[keywords], "{TOPGAMES}" => getHyperGames(0,10,"DESC","hits", "Latest Top Games"), "{CONTENT}" => $template1->output($settings[template],"false"), "{DOMAIN}" => $settings[domain], "{YEAR}" => $settings[year]));
// disconnect from database
disdb();
// display templates: main page now located inside templateWrapper
echo $templateWrapper->output($settings[template]);
I get this error when running the page:"{FILEN}" => "media/games/" . $gameInfo[filename]
Now if I change just one letter, in that line I mentioned earlier, everything works fine, no fatal error.Warning: Unexpected character in input: '' (ASCII=4) state=1 in /home/arcade/public_html/media/games/alpine_escape2.swf on line 81
Parse error: parse error, unexpected T_STRING in /home/arcade/public_html/media/games/alpine_escape2.swf on line 81
For example, change this:
to this:"{FILEN}" => "media/games/" . $gameInfo[filename]
Everything works just fine then (except ofcourse my swf won't show as the path is now wrong)."{FILEN}" => "media/games/" . $gameInfo[filename]
Anyone have any idea at all what is going on here??!! It seems like php is trying to open the swf file, or include it. But if it was, when I change the path to the swf, php should error saying it can't find the file.
HELP! lol
Thankyou all,
Rhett.





