User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Jan 2007
Posts: 6
Reputation: melefire is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
melefire melefire is offline Offline
Newbie Poster

Question simple url variable

  #1  
Feb 7th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2003
Location: Toronto, Canada
Posts: 354
Reputation: Gary King will become famous soon enough Gary King will become famous soon enough 
Rep Power: 6
Solved Threads: 5
Colleague
Gary King's Avatar
Gary King Gary King is offline Offline
PHP/vBulletin Guru

Re: simple url variable

  #2  
Feb 7th, 2007
[php]<?php

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

?>[/php] as an example.
Reply With Quote  
Join Date: Jan 2007
Posts: 6
Reputation: melefire is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
melefire melefire is offline Offline
Newbie Poster

Re: simple url variable

  #3  
Feb 8th, 2007
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
Reply With Quote  
Join Date: Jan 2007
Posts: 37
Reputation: jblacdao is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 3
jblacdao jblacdao is offline Offline
Light Poster

Re: simple url variable

  #4  
Feb 16th, 2007
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>
Last edited by jblacdao : Feb 16th, 2007 at 4:12 am.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 2:38 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC