| | |
simple url variable
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jan 2007
Posts: 6
Reputation:
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
[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:
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
PHP Syntax (Toggle Plain Text)
print $_GET['dlurl'];
Is this what u were looking for? or if you want it to appear as a link on your new page
PHP Syntax (Toggle Plain Text)
<a href="<?=$_GET['dlurl']?>" >DOWNLOAD FILE</a>
Last edited by jblacdao; Feb 16th, 2007 at 5:12 am.
![]() |
Similar Threads
- PHP URL variables and if statement (PHP)
- Variables in the URL - and how to get them (HTML and CSS)
- Help with 301 redirect code - jsp in url (JSP)
- 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
| Thread Tools | Search this Thread |
.htaccess alerts apache api archive array autocomplete beginner binary broken cakephp checkbox class cms code convert cron curl database dataentry date display duplicates dynamic echo email emptydisplayvalue error execute explodefunction file files firstoptioninphpdroplist folder form forms function functions google hack href htaccess html htmlspecialchars image include insert ip javasciptvalidation javascript joomla keywords limit link login mail matching menu methods mlm multiple mysql network object oop paypal pdf php problem query radio random recursion recursive redirect remote script search securephp server sessions shot sms source space sql subscription syntax system table tutorial tutorials update upload url validator variable video web youtube





