Is there a way to force download php files? I know how to do this with pdfs and things but php files do not seem to work in the same way. They download but have no content.
Thanks.

Thanks.
| Dougie1 wrote: |
| Is there a way to force download php files? I know how to do this with pdfs and things but php files do not seem to work in the same way. They download but have no content. |
| Code: |
| <?php
header('Content-Type: application/octet-stream; charset=us-ascii'); // must use substr(<PHP_SELF>, 1) to remove leading slash header('Content-Disposition: attachment; filename="' . substr($_SERVER['PHP_SELF'], 1) . '"'); readfile(substr($_SERVER['PHP_SELF'], 1)); ?> |
| Dougie1 wrote: |
| Is there a way to force download php files? I know how to do this with pdfs and things but php files do not seem to work in the same way. They download but have no content.
Thanks. |
| scorpio wrote: |
| I was actually wondering if there is a method to download a php file from any particular site like www.xyz.com/index.php [which is not my site] or something like that.
I am not very familiar with PHP, hexkid, but can your code do the above operation? |
| hexkid wrote: |
| I am not very familiar with PHP, hexkid, but can your code do the above operation? |