RE: [PHP] Routing downloads through PHP - Thanks!

2006-02-15 Thread R. Van Tassel
] Sent: Wednesday, February 15, 2006 6:39 PM To: php-general@lists.php.net Subject: Re: [PHP] Routing downloads through PHP - Thanks! Thanks everyone, especially Barry for that great script which I've tested on a home server and _does_ work... So, I'm going to wait for my external hosting

Re: [PHP] Routing downloads through PHP - Thanks!

2006-02-15 Thread J_K9
Thanks everyone, especially Barry for that great script which I've tested on a home server and _does_ work... So, I'm going to wait for my external hosting company to get back to me and alter the files there so that it'll work on my website. Thanks again! ;-) J_K9 -- PHP General Mailing Li

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9
Barry wrote: Michael Crute wrote: May I suggest you get a cheap box (you could build one for a few hundred bucks, or ebay), get a copy of and do development locally, beats the heck out of external hosting for development/learning stuff. -Mike probably. yes. But when you have some bad hosti

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Barry
Michael Crute wrote: May I suggest you get a cheap box (you could build one for a few hundred bucks, or ebay), get a copy of and do development locally, beats the heck out of external hosting for development/learning stuff. -Mike probably. yes. But when you have some bad hosting provider us

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Michael Crute
On 2/15/06, J_K9 <[EMAIL PROTECTED]> wrote: > Barry wrote: > > J_K9 wrote: > >> Duncan Hill wrote: > >> > >>> On Wednesday 15 February 2006 11:35, J_K9 wrote: > >>> > Duncan Hill wrote: > > > On Wednesday 15 February 2006 11:05, J_K9 wrote: > > > >> Here's the exact 500 error

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9
Barry wrote: J_K9 wrote: Duncan Hill wrote: On Wednesday 15 February 2006 11:35, J_K9 wrote: Duncan Hill wrote: On Wednesday 15 February 2006 11:05, J_K9 wrote: Here's the exact 500 error I'm getting: Standard Apache error. Look in your error log for more details like it suggests?

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Barry
J_K9 wrote: Duncan Hill wrote: On Wednesday 15 February 2006 11:35, J_K9 wrote: Duncan Hill wrote: On Wednesday 15 February 2006 11:05, J_K9 wrote: Here's the exact 500 error I'm getting: Standard Apache error. Look in your error log for more details like it suggests? I would, but I

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9
Duncan Hill wrote: On Wednesday 15 February 2006 11:35, J_K9 wrote: Duncan Hill wrote: On Wednesday 15 February 2006 11:05, J_K9 wrote: Here's the exact 500 error I'm getting: Standard Apache error. Look in your error log for more details like it suggests? I would, but I can't find it. I th

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Duncan Hill
On Wednesday 15 February 2006 11:35, J_K9 wrote: > Duncan Hill wrote: > > On Wednesday 15 February 2006 11:05, J_K9 wrote: > >> Here's the exact 500 error I'm getting: > > > > Standard Apache error. Look in your error log for more details like it > > suggests? > > I would, but I can't find it. I t

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9
Duncan Hill wrote: On Wednesday 15 February 2006 11:05, J_K9 wrote: Here's the exact 500 error I'm getting: Standard Apache error. Look in your error log for more details like it suggests? I would, but I can't find it. I thought it was under /var/log, but having taken a good look I just c

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Duncan Hill
On Wednesday 15 February 2006 11:05, J_K9 wrote: > Here's the exact 500 error I'm getting: Standard Apache error. Look in your error log for more details like it suggests? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9
Barry wrote: Technically: PHP is server sided, so anything that is sended to browser like HTML output is output. Any output in text format sended to the browser (HTML headers and such) will be recognized as normal output. The header you set with header() is a HTTP header not HTML header. that

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Barry
J_K9 wrote: Well, technically that isn't text output - it's only setting a title... ;) Technically: PHP is server sided, so anything that is sended to browser like HTML output is output. Any output in text format sended to the browser (HTML headers and such) will be recognized as normal outpu

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Stut
J_K9 wrote: Well, technically that isn't text output - it's only setting a title... ;) 'Technically' anything that gets sent to the browser is output. Why are you trying to set a title when you are sending a binary file? An HTML title is only relevant if you're returning HTML to the client.

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9
Lines 1-10: Downloads Exactly! HTML "is" output ya know? Well, technically that isn't text output - it's only setting a title... ;) Anyway, I moved the PHP to the top of the file (ie. before the HTML), but now I'm getting a 500 Internal error... Here's the full code I'm using:

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Barry
J_K9 wrote: Barry wrote: J_K9 wrote: This is what I used: As you can see, there is no output before the headers are set. In fact, the error say that the headers were set on line 6, which is default headers? Thanks, J_K9 What is before line 6? Because the Lines 1-10: --

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9
Barry wrote: J_K9 wrote: This is what I used: As you can see, there is no output before the headers are set. In fact, the error say that the headers were set on line 6, which is default headers? Thanks, J_K9 What is before line 6? Because the Lines 1-10: Downloads

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Barry
J_K9 wrote: This is what I used: As you can see, there is no output before the headers are set. In fact, the error say that the headers were set on line 6, which is can this be? Is there something I need to turn off like default headers? Thanks, J_K9 What is before line 6? Bec

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9
Barry Krein wrote: J_K9 wrote: Barry wrote: J_K9 wrote: Curt Zirzow wrote: On Tue, Feb 14, 2006 at 09:02:50PM +, J_K9 wrote: Hi, I'm currently learning PHP, and I'd like to put it into practice to help me learn. I want to make a download script so that if the value of a certain

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9
Barry wrote: J_K9 wrote: Curt Zirzow wrote: On Tue, Feb 14, 2006 at 09:02:50PM +, J_K9 wrote: Hi, I'm currently learning PHP, and I'd like to put it into practice to help me learn. I want to make a download script so that if the value of a certain variable is '1', the first download

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread Barry
J_K9 wrote: Curt Zirzow wrote: On Tue, Feb 14, 2006 at 09:02:50PM +, J_K9 wrote: Hi, I'm currently learning PHP, and I'd like to put it into practice to help me learn. I want to make a download script so that if the value of a certain variable is '1', the first download is selected, if

Re: [PHP] Routing downloads through PHP

2006-02-15 Thread J_K9
Curt Zirzow wrote: On Tue, Feb 14, 2006 at 09:02:50PM +, J_K9 wrote: Hi, I'm currently learning PHP, and I'd like to put it into practice to help me learn. I want to make a download script so that if the value of a certain variable is '1', the first download is selected, if it's '2', the

Re: [PHP] Routing downloads through PHP

2006-02-14 Thread Curt Zirzow
On Tue, Feb 14, 2006 at 09:02:50PM +, J_K9 wrote: > Hi, > > I'm currently learning PHP, and I'd like to put it into practice to help > me learn. I want to make a download script so that if the value of a > certain variable is '1', the first download is selected, if it's '2', > the second is

Re: [PHP] Routing downloads through PHP

2006-02-14 Thread J_K9
(Reply beneath quotes) Richard Lynch wrote: On Tue, February 14, 2006 3:41 pm, J_K9 wrote: "data/download1.zip", "a1"=>"data/download2.zip"); $location = $filearray['a'.$fileid]; if($location!='') { header("LOCATION: $location"); } ?> But when I send it: http://

Re: [PHP] Routing downloads through PHP

2006-02-14 Thread Richard Lynch
On Tue, February 14, 2006 3:41 pm, J_K9 wrote: > > $fileid = $_GET['file_id']; > > $filearray = array( > "a0"=>"data/download1.zip", > "a1"=>"data/download2.zip"); > > $location = $filearray['a'.$fileid]; > > if($location!='') { > > header("LOCATION: $location"); > > } > > ?> > ---

RE: [PHP] Routing downloads through PHP

2006-02-14 Thread Shaunak Kashyap
transmission in error, please notify the sender by reply e-mail and destroy all copies of this transmission. -Original Message- From: J_K9 [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 14, 2006 1:42 PM To: php-general@lists.php.net Subject: Re: [PHP] Routing downloads through PHP Hi

Re: [PHP] Routing downloads through PHP

2006-02-14 Thread J_K9
Hi, Thanks for replying. Here's the code I put into download.php: - "data/download1.zip", "a1"=>"data/download2.zip"); $location = $filearray['a'.$fileid]; if($location!='') { header("LOCATION: $location"); } ?> But when I send it: http://example.com/

[PHP] Routing downloads through PHP

2006-02-14 Thread J_K9
Hi, I'm currently learning PHP, and I'd like to put it into practice to help me learn. I want to make a download script so that if the value of a certain variable is '1', the first download is selected, if it's '2', the second is selected, and so on... But, all the time, the download source's