0

Hello,


i am creating a simple website for a friend. There is a download page that waits 3 seconds bafore redirecting the user directly to the file. I dont want to make a redirect page for each file. so i figured i could put this in the url:

download.php?dlurl=URL OF FILE

i can do that but how would i then put it into my page as a redirect? with the variable and all?

could someone please help me a bit here?

thanks

3
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by jblacdao
0
<?php

if ($_GET['dlurl'])
{
	header('Content-type: application/pdf');
	header('Content-Disposition: attachment; filename="downloaded.pdf"');
	readfile('original.pdf');
}

?>

as an example.

0

thank you but that does not make sense. i want it to be automated, it shhould not matter about the file type, i just want to be able to print the text after the ?dlurl= on the page.

somebody please help

0

You can access the text as how Gary used it in his example. Its basically like accessing a variable you have declared only you got from the previous page.

print $_GET['dlurl'];

Is this what u were looking for? or if you want it to appear as a link on your new page

<a href="<?=$_GET['dlurl']?>" >DOWNLOAD FILE</a>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.