$url = $_SERVER['HTTP_REFERER']; $START_CONT = ""; $END_CONT = ""; $content=0; $parsed_url = parse_url($url); $myScheme = $parsed_url['scheme']; $myServer = $parsed_url['host']; $port = $parsed_url['port']; $document = $parsed_url['path']; $url = preg_replace('/[[:space:]]/','+',$url); if($document[strlen($document)-1]=='/'){ // Set this to your homepage (e.g. welcome.htm) $document = "$document/welcome.htm"; } $fullPath = "/webtst1/app1/bcedtst1/www$document"; ?>
$f_contents = file ($fullPath); //parses the file into an array foreach($f_contents as $line){ //evaluates each line of the array if(ereg($START_CONT,$line)){ //looks for the start of the content $content=1; } if(ereg($END_CONT,$line)){ //looks for the end of the content $content=0; } if($content==1){ //prints content between start and end echo $line; } } ?>