| | |
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 |
apache api array beginner binary broken cache cakephp checkbox class cms code confirm cron curl customizableitems database date display dynamic echo email error external fcc file files folder form forms forum freelancing function functions google header headmethod howtowriteathesis href htaccess html iframe image include insert ip javascript joomla limit link login mail malfunction menu method mlm mod_rewrite multiple mysql neutrality oop pageing pagerank paypal pdf php phpmysql play problem query question radio random recursion remote root script search select server sessions sms soap source space sql support! syntax system table template tutorial update upload url validator variable video web youtube





