$filename = "http://www.google.com/index.html"; $file = fopen($filename, "r"); $contents = fread($file, filesize ($filename)); fclose ($file); echo $contents;
why won't this work?
Hmm, several reasons present themselves. the manual says it better than I can.
HTH,
$handle = fopen ("http://www.example.com/", "r");
This file in the manual should allow me to do what I wan't.
So why not?
You're receiving no error messages?
Is allow_url_fopen set in php.ini?
Warning: stat failed for http://www.google.com/ (errno=2 - No such file or directory) in c:\program files\apache group\apache\htdocs\adminmenu.triple on line 210
and yes.....allow_url_fopen is set to "ON"
Well, sure looks as if it can't handle the protocol.
I did find this, which may interest you...http://google.compholio.com/
Try specifying the page too, like index.html or whatever it is.
Diego
...and note that [man]filesize()[/man] is undefined for remote files...
If you only gonna echo out the file, use
readfile("http://google.com/index.html");