simple url variable

Reply

Join Date: Jan 2007
Posts: 6
Reputation: melefire is an unknown quantity at this point 
Solved Threads: 0
melefire melefire is offline Offline
Newbie Poster

simple url variable

 
0
  #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
Reply With Quote Quick reply to this message  
Join Date: Nov 2003
Posts: 360
Reputation: Gary King will become famous soon enough Gary King will become famous soon enough 
Solved Threads: 5
Team Colleague
Gary King's Avatar
Gary King Gary King is offline Offline
PHP/vBulletin Guru

Re: simple url variable

 
0
  #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 Quick reply to this message  
Join Date: Jan 2007
Posts: 6
Reputation: melefire is an unknown quantity at this point 
Solved Threads: 0
melefire melefire is offline Offline
Newbie Poster

Re: simple url variable

 
0
  #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 Quick reply to this message  
Join Date: Jan 2007
Posts: 37
Reputation: jblacdao is an unknown quantity at this point 
Solved Threads: 3
jblacdao jblacdao is offline Offline
Light Poster

Re: simple url variable

 
0
  #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.

  1. print $_GET['dlurl'];

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

  1. <a href="<?=$_GET['dlurl']?>" >DOWNLOAD FILE</a>
Last edited by jblacdao; Feb 16th, 2007 at 5:12 am.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC