Unstoppable Domains

Some SERIOUSLY weird stuff going on here, help! please!

Spaceship Spaceship
Watch
Impact
109
Hey all,

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]);
Now the problem is on line 35, at the end:
"{FILEN}" => "media/games/" . $gameInfo[filename]
I get this error when running the page:
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
Now if I change just one letter, in that line I mentioned earlier, everything works fine, no fatal error.
For example, change this:
"{FILEN}" => "media/games/" . $gameInfo[filename]
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).

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.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
FIXED!

lol, thank god for that...

Turns out there was an error in my templater. It checs to see if the string to be replaced is a path to an existing file, if it is, then it tries to open it up :P.

Thanks anyway all.
 
0
•••
Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back