Php pasajı ile Url ve başlık

0 Cevap

Ben birkaç benzer mesajları okudum ama benim hata görmüyorum.

: index.php gibi görünüyor

<head>
<title>Demo Title</title>
</head>
<body>
<?php 
    require_once "footer.php";
?>
</body>

: footer.php gibi görünüyor

<?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 -- ";
}
?>

In URL için bir istek http://127.0.0.1/test/index.php sonuçları:

http://127.0.0.1/test/index.phpCan't open HTTP_REFERER.

ya için http://127.0.0.1/test/

http://127.0.0.1/test/Can't open HTTP_REFERER.

Herhangi bir ipuçları takdir.

0 Cevap