Quote:
| 2) How would you reference an off-server script as the source? |
Good question via shell (I know you can ping from the shell and do other net things... so what you would use depends on what's installed or what's built in -- offhand I forget what some of the possiblities are).
Another way might be to write a php script that gets the file from a URL and pipes the output as before. The following is NOT tested, just what seems like a possible approach for the "/this/is/job/num1.php":
PHP Code:
<?php
$fp = fopen ("http://www.php.net/", "r");
fpassthru($fp);
exit;
?>
Just replace the URL (
http://www.php.net ) with the URL to your script. Since PHP and CGI are server-side, they'll pump out the same info to a browser or a script (sans cookies and other complications

). I don't always have good luck with the short & sweet version of fopen() and use the fsockopen() instead... but fopen() ought to work just as well in most cases.
NOTE 1: this method will not download any pics unless they're full URLs. In fact. if the HTML code does NOT show relative links (pics, downloads, whatever with short links), it'll work OK from another server. Otherwise, you'll need to processes the return page and save or, better, fix all the relative links up somehow. Could be some work and I can't think of any quick fixes off hand. Perhaps a shell using lynx to download the entire page might handle this job better? I dunno much about Lynx.
NOTE 2: This is a pipe to a pipe. You might want to see what happens when your remote script URL is broken... in case a site goes down during "live time". A simple "if(something broken) { return;}" might fix it.
NOTE 3: Security... if you are running this as a normal user, then you should be okay since it's HTML and not an executable you're making here. Still... be aware that others can put things onto your server with this. Of course, you still control which URLs may donate to your file.
If things are simple you could be done.
Good luck!
Because things are rarely simple.