[PHP] Simple example of expiring download pages?

2004-02-21 Thread Brian Dunning
Hi, I'm building a very simple online store and I need expiring 
download pages for people to download the items they purchased. 
Surprisingly, I couldn't find an example of this code online.

I know how to do it in Lasso, and it's quite easy. You just search the 
database against download attempts or expiration time/date, and if it 
succeeds, return this (it's Lasso code but you get the idea):

[Output_None]
[Var: 'file' = (Include_Raw: 'pathname/sourcefile.zip')]
[Var: 'filename' = 'product.pdf']
[Var: 'content_type' = 'application/pdf']
[Header]
  HTTP/1.0 200 OK
  Server: Lasso/6.0
  Content-Type: [$content_type]
  Content-Length: [$file-Length]
  Content-Disposition: attachment; filename=[$filename]
[/Header]
[/Output_None][$file]
Can anyone suggest the PHP code for this?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Simple example of expiring download pages?

2004-02-21 Thread Jason Wong
On Saturday 21 February 2004 21:41, Brian Dunning wrote:
 Hi, I'm building a very simple online store and I need expiring
 download pages for people to download the items they purchased.
 Surprisingly, I couldn't find an example of this code online.

 I know how to do it in Lasso, and it's quite easy. You just search the
 database against download attempts or expiration time/date, and if it
 succeeds, return this (it's Lasso code but you get the idea):

[snip]

 Can anyone suggest the PHP code for this?

Loads of examples in the archives, search for download file or similar.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Those who can, do; those who can't, simulate.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php