BoR|S
11-19-2003, 05:45 AM
Let's say I have a remote page: www.website.com/somepage.html
How do I remotly view it's source code? By opening a socket and using GET header to recieve the source? Another way?
I need it to be something like www.mysite.com/showsource.php?page=www.website.com/somepage.html
Is that possible at all?
EDIT: I was suggested in another forum to use the following:
$f=file("http://".$_GET['page']);
So I made this showsource.php file:
<?php
$f=file("http://".$_GET['page']);
?>
But when I run it, I get the following error:
Warning: php_hostconnect: connect failed in /home/boris/htdocs/showsource.php on line 2
Warning: file("http://www.website.com/somepage.html") - Bad file descriptor in /home/boris/htdocs/showsource.php on line 2
What's the problem in here?
How do I remotly view it's source code? By opening a socket and using GET header to recieve the source? Another way?
I need it to be something like www.mysite.com/showsource.php?page=www.website.com/somepage.html
Is that possible at all?
EDIT: I was suggested in another forum to use the following:
$f=file("http://".$_GET['page']);
So I made this showsource.php file:
<?php
$f=file("http://".$_GET['page']);
?>
But when I run it, I get the following error:
Warning: php_hostconnect: connect failed in /home/boris/htdocs/showsource.php on line 2
Warning: file("http://www.website.com/somepage.html") - Bad file descriptor in /home/boris/htdocs/showsource.php on line 2
What's the problem in here?