944,089 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 4987
  • PHP RSS
Feb 7th, 2007
0

simple url variable

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
melefire is offline Offline
6 posts
since Jan 2007
Feb 7th, 2007
0

Re: simple url variable

[php]<?php

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

?>[/php] as an example.
Team Colleague
Reputation Points: 53
Solved Threads: 5
PHP/vBulletin Guru
Gary King is offline Offline
360 posts
since Nov 2003
Feb 8th, 2007
0

Re: simple url variable

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
melefire is offline Offline
6 posts
since Jan 2007
Feb 16th, 2007
0

Re: simple url variable

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.

PHP Syntax (Toggle Plain Text)
  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

PHP Syntax (Toggle Plain Text)
  1. <a href="<?=$_GET['dlurl']?>" >DOWNLOAD FILE</a>
Last edited by jblacdao; Feb 16th, 2007 at 5:12 am.
Reputation Points: 12
Solved Threads: 3
Light Poster
jblacdao is offline Offline
37 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: show content from another sites's database
Next Thread in PHP Forum Timeline: Black Response





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC