Frames With PHP fsockopen
Posted: Sat Nov 11, 2006 11:28 pm
Hello, I am new to php and these forums.
I am interested in how to make a page with just a frame. I want that frame to contain a website if it is online, but if it is offline I just want the page to say so.
If you click links I want it to stay on the current site, but for the frame to change to that link...
I have found out some of my help here:
But it shows a bunch of text at the top that I do not want, and it doesn't show images. How do I get this all in a frame and have it show images and get rid of all of that text at the top?
The reason for all of this is that I am going to try and setup one of my old pcs to be a web server. I don't want it on all of the time and don't want users to see that "Page cannot be displayed" page. I have got it almost all done. I got a new internet connection and I got trendmicro internet security 2007 on it. If I want to make it more secure what would anybody recommend?
Thanks
I am interested in how to make a page with just a frame. I want that frame to contain a website if it is online, but if it is offline I just want the page to say so.
If you click links I want it to stay on the current site, but for the frame to change to that link...
I have found out some of my help here:
Code: Select all
<?php
error_reporting(0);
$fp = fsockopen("www.google.com", 80);
if (!$fp) {
echo 'I Am Sorry, But This Website Is Currently Down.'; //"$errstr ($errno)<br />\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: http://www.google.com\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>The reason for all of this is that I am going to try and setup one of my old pcs to be a web server. I don't want it on all of the time and don't want users to see that "Page cannot be displayed" page. I have got it almost all done. I got a new internet connection and I got trendmicro internet security 2007 on it. If I want to make it more secure what would anybody recommend?
Thanks