tags:

views:

219

answers:

4
+3  Q: 

$_GET without foo

How can I use download.php?get=file.exe with without the get variable, like download.php?=file.exe, using the $_GET in PHP?

+8  A: 

You can use $_GET[0] or $_REQUEST[0]

Pooria
+1  A: 

What you need i address rewritting this wikipedia article should give you enough information to stat with. Specifically, if you use apache, read about mod_rewrite.

ya23
Seems like I've misunderstood question a bit. Well... :)
ya23
+1  A: 

You can use $_SERVER['QUERY_STRING'] to get everything after the ?.

Edit: Then you could use download.php?file.exe

Anders S
+5  A: 

You could use $_SERVER['request_uri'] which would allow you to omit the ? completely, leaving you with URLs like example.com/download.php/file.exe

Then, with a bit of URL rewriting (or implementing a bootstrap controller) you could clean it up even more, resulting in example.com/download/file.exe

Michael Wales