The handling of '?sce=view' is done by a small chunk of code
if (isset($_REQUEST['sce']) && strtolower($_REQUEST['sce']) == 'view' ) {
//--self downloader --
$filenameReal = __FILE__;
$download_size = filesize($filenameReal);
header('Pragma: public');
header('Cache-Control: private');
header('Cache-Control: no-cache, must-revalidate');
header("Content-type: text/plain");
header("Accept-Ranges: bytes");
header("Content-Length: $download_size");
header('Connection: close');
readfile($filenameReal);
exit;
}
that appears just after the local parameter settings. It should work on all PHP installations as it uses the default
__FILE__ global as the target for the
readfile($filenameReal);. No extra PHP settings are required.
Some of the older versions of my scripts used
$_SERVER["..."]; arguments for the
__FILE__ and depending on the server (Apache v.s. IIS) it may not have had the particular $_SERVER[] value implemented .. that's why I'd switched to the
__FILE__ which does work on Apache or IIS servers.
If you use the '?sce=view' on a page that has multiple includes (like wxadvisory.php), then the first script included on the page will respond and print it's contents, not the contents of the including page.
I, too, use this function frequently to help diagnose issues with script implementations on folks sites .. much easier than having them send the script and trying to replicate the issue on your server
Hope this helps...
Best regards,
Ken