\n"; // this function turns relative links into absolute links. for ../../ relative file // paths it works out how many directories to knock off the base path function link_rep() { global $buff, $start, $end, $dir_cnt, $directories; $link=substr($buff, $start, $end-$start); if((strpos(" ".$link, "http://")!=1)&&(strpos(" ".$link, "/")!=1)) { // don't translate absolute url's $num_directories=$dir_cnt; $link_directories=explode("/", $link); // count the number of directories to knock off the start, or // add directory to path as appropriate $tmp_link=""; for($i=0; $i"; } $end=0; while($start=strpos($buff, "", $end)) { $end=$start+8; // replace the link $buff=substr_replace($buff, $link, $start, $end-$start); } header("Content-Type: text/html"); echo $buff; die; // other files just get served } elseif($ext==".jpg"||$ext==".jpeg") $ctype="image/jpeg"; elseif($ext==".gif") $ctype="image/gif"; elseif($ext==".png") $ctype="image/png"; elseif($ext==".txt") $ctype="text/plain"; header("Content-Type: $ctype"); readfile($filepath); $camefrom=""; die; } // we're gonna try and make 'em log on, so we need to save the url to come // back to $camefrom=$url; $_SESSION['camefrom'] = $url; // $msg="Archive Site Login\n\nYou need to be a paid member to view this content\nPlease login or register"; $msg="Archive Site Login\n\nPlease login. If you are not a paid member, you will need to register and purchase a membership"; // echo "\n"; header("Location: logon.php"); // echo "\n"; ?>