   [web] PHP: Opening a PHP file using a query string
  I have 2 PHP scripts. One does a lot of data processing and the other acts as an HTML template which "drops in" a few GET values (echo $_REQUEST[...] type stuff).My problem is, I want to SAVE the HTML output from the template to a file from within the first PHP script. Currently, I have been trying file_get_contents, but after about 20 minutes of messing with it, I realized it doesn't work with HTML query strings.Simply put, I need a way to save the HTML output of template.php?key=value to a file with another PHP file.   
  Why not include the second file in the first one and capture the output with an output buffer (ob_start() - ob_get_contents())?   ;  ob_start();include('template.php'); $html = ob_get_clean(); // assigns the buffer to $html and clears it;  Have you tried this?$file = fopen('http://example.com', 'r');PHP allows you to open a URL (including query strings, I assume) as a file stream.  You could read the stream and save it to a file.   