I am using a frame redirect script like this below. If the URL is wrong or dead, then I get some errors, otherwise it works. Any ideas what the problem might be?
link:
http://vwfanatic.com/redirect.php?url=http://myvwgallery.com
script:
$SETUP[height] = "40";
$SETUP[topframe] = "http://www.vwfanatic.com/top.htm";
if ($url) {
$lines_array = file($url);
$lines_string = implode('', $lines_array);
eregi("<head>(.*)</head>", $lines_string, $head);
?>
<HTML>
<HEAD>
<?php echo $head[0]; ?>
</HEAD>
<FRAMESET frameborder="0" rows="<?php echo $SETUP[height]; ?>,*">
<FRAME src="<?php echo $SETUP[topframe]; ?>" scrolling="NO">
<FRAME src="<?php echo $url; ?>">
<NOFRAMES>
<BODY>
</BODY>
</NOFRAMES>
</FRAMESET>
</HTML>
<?php
exit();
} else {
header("Location: http://www.vwfanatic.com");
exit();
}
errors:
Warning: php_network_getaddresses: getaddrinfo failed:
Warning: file("http://myvwgallery.com") - Bad file descriptor
Warning: Bad arguments to implode()
Any advice is appreciated. If a link does go bad I want the script to go back to my homepage.