Url and title with php snippet

Emso

New Member
I read several similar posts but I don't see my fault.index.php looks like:\[code\]<head><title>Demo Title</title></head><body><?php require_once "footer.php";?></body>\[/code\]footer.php looks like:\[code\]<?php/* * _$ Rev. : 08 Sep 2010 14:52:26 $_ * footer.php */$host = $_SERVER['SERVER_NAME'];$param = $_SERVER ['REQUEST_URI'];$url = "http://".$host.$param;echo $url;$file = @ fopen($_SERVER[$url],"r") or die ("Can't open HTTP_REFERER.");$text = fread($file,16384);if (preg_match('/<title>(.*?)<\/title>/is',$text,$found)) { $title = $found[1];} else { $title = " -- no title found -- ";}?>\[/code\]A request for the URL http://127.0.0.1/test/index.php results in:\[code\]http://127.0.0.1/test/index.phpCan't open HTTP_REFERER.\[/code\]or for http://127.0.0.1/test/ \[code\]http://127.0.0.1/test/Can't open HTTP_REFERER.\[/code\]Any hints appreciated.
 
Back
Top