how to invoke a HTTP request in PHP?

  • Thread starter Thread starter [ J ] a [ Y ]
  • Start date Start date
J

[ J ] a [ Y ]

Guest
Hi guys. Basically I'd like to invoke an HTTP request in PHP which requests the HTML of a particular page (or direct file download, whichever. I really only need the HTML code though). The file is not on my server so I cant use fopen().

I'd like to download the HTML of a file and store it in a variable (or copy the file itself). Stuff like:

$x = fopen("http://www.google.com/index.html", 'r');

doesnt work. My request times out all the time. Any pointers?
javascript and ajax wont work. Keep in mind the remote file I'm trying to open is not expecting an AJAX injection, thus it will not respond appropriately. I just need to open it remotely.
Thanks for the PHP code. However, it is still timing out. I'm not sure if that might be due to my own settings tho
 
Back
Top