Page 1 of 1

test.php?test

Posted: Fri May 27, 2005 1:00 am
by William
Dear all,

I was wondering if anyone knows how to make it so when I went to lets say... download.php?filename.zip I could make it print that file name? Basicly what is the varible for it? I know download.php?file=filename.zip or somthing would work but I was wondering what the varible ?blank was. Thanks

Posted: Fri May 27, 2005 1:25 am
by hongco
use mode rewrite so that the variable does not show up on the link.

oops, i misread his question ..sorry

Posted: Fri May 27, 2005 3:46 am
by Bennettman
Alternatively:

Code: Select all

<?php

$uri = explode('?', $_SERVER['REQUEST_URI']);
$file = $uri[1];

?>

Posted: Fri May 27, 2005 6:34 am
by William
Hey,

It worked! Thanks for the help. :)