Ad

The Whole Index.php?=.exe

- 1 answer

I've never really understood on how to do it. I want to where where I can type my address, followed by /index.php?=<a file that is on the FTP>.exe. From there, I would be direct to a page that has a download now button and maybe something like a ad.

Anyone have any tutorials or guides that I may look at?

Ad

Answer

I think he is on about simple $_GET requests >.<

<?php

$file = $_GET['file'];

if (file_exists($file)) {
   header('Content-Type: application/octet-stream');
   echo file_get_contents($file);
}

?>

Ofcourse this is a very basic example with no security at all. Its not reccomended for you to use this in production without upping security on it.

Ad
source: stackoverflow.com
Ad