•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,695 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,165 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1695 | Replies: 3
![]() |
•
•
Join Date: Jan 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 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:
[HTML]download.php?dlurl=URL OF FILE[/HTML]
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
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:
[HTML]download.php?dlurl=URL OF FILE[/HTML]
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
•
•
Join Date: Nov 2003
Location: Toronto, Canada
Posts: 354
Reputation:
Rep Power: 6
Solved Threads: 5
[php]<?php
if ($_GET['dlurl'])
{
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="downloaded.pdf"');
readfile('original.pdf');
}
?>[/php] as an example.
if ($_GET['dlurl'])
{
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="downloaded.pdf"');
readfile('original.pdf');
}
?>[/php] as an example.
•
•
Join Date: Jan 2007
Posts: 37
Reputation:
Rep Power: 2
Solved Threads: 3
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.
Is this what u were looking for? or if you want it to appear as a link on your new 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>
Last edited by jblacdao : Feb 16th, 2007 at 4:12 am.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
Similar Threads
- Variables in the URL - and how to get them (HTML and CSS)
- Help with 301 redirect code - jsp in url (JSP)
- PHP URL variables and if statement (PHP)
- how to get pass url variables from one page to another page with out knowing them? (ColdFusion)
Other Threads in the PHP Forum
- Previous Thread: show content from another sites's database
- Next Thread: Black Response


Linear Mode