test.php?test

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

test.php?test

Post 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
hongco
Forum Contributor
Posts: 186
Joined: Sun Feb 20, 2005 2:49 pm

Post by hongco »

use mode rewrite so that the variable does not show up on the link.

oops, i misread his question ..sorry
Last edited by hongco on Fri May 27, 2005 3:48 am, edited 1 time in total.
Bennettman
Forum Contributor
Posts: 130
Joined: Sat Jun 15, 2002 3:58 pm

Post by Bennettman »

Alternatively:

Code: Select all

<?php

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

?>
User avatar
William
Forum Contributor
Posts: 332
Joined: Sat Oct 25, 2003 4:03 am
Location: New York City

Post by William »

Hey,

It worked! Thanks for the help. :)
Post Reply