### We need to know what page is the user coming from and the title of that page.
#print_r($GLOBALS);
$wherefrom = getenv("HTTP_REFERER");
if ($wherefrom == "") {
$wherefrom = $_GET[url];
}
$pos = strpos($wherefrom,"commandconquer3.com");
if ($pos > 0) {### Is comming from our website
$file = $_SERVER[DOCUMENT_ROOT] . substr($wherefrom,$pos+19);
if (is_dir($file)) { $file .= "/index.html"; } ## If is a directory, we get the index.html page
$fd = fopen ($file,"r");
while (!feof ($fd)) {
$buffer = fgets($fd, 4096);
$strl = strtolower($buffer);
if (strpos($strl,"
") > -1) { $strl = str_replace("","",$strl); }
if (strpos($strl,"") > 0) { $strl = str_replace("","",$strl); $title = ucwords($strl); break; }
}
}
if ($title == "") {$title = "Command and Conquer 3";}
$output =<<< HTML
Return to $title
|
Text Link to referring page
Link Appears As:
$title
|
HTML;
$menu = file_get_contents("includes/cc3menu_top.html");
$menu2 = file_get_contents("includes/cc3menu2.html");
$template = file_get_contents("includes/template.html");
$bkmrk = file_get_contents("includes/bkmrk.html");
$buffer = str_replace("+++MENU_TOP+++","$menu",$template);
$buffer = str_replace("+++MENU_2+++","$menu2",$buffer);
$buffer = str_replace("+++TITLE+++","Link to Us",$buffer);
$buffer = str_replace("+++BKMRK+++","$bkmrk",$buffer);
$buffer = str_replace("+++CONTENT+++","$output",$buffer);
print $buffer;
?>