Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Date: Tue, 10 Jan 2012 11:50:58 +0100 From: Luuk User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 Newsgroups: comp.lang.php Subject: Re: Running function in the background? References: <9k9ng7h2c1vp889pgfoeh7eko566amljg7@4ax.com> In-Reply-To: <9k9ng7h2c1vp889pgfoeh7eko566amljg7@4ax.com> X-Enigmail-Version: 1.3.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: Lines: 37 NNTP-Posting-Host: 2001:980:9089:1:216:76ff:fee1:aa6c X-Trace: 1326192901 news.xs4all.nl 6962 [2001:980:9089:1:216:76ff:fee1:aa6c]:57077 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.php:4391 On 10-01-2012 03:50, Michael Joel wrote: > On Mon, 9 Jan 2012 20:32:43 -0500, John Drako > wrote: > >> I have a site where users can download files, and I want to enable the >> users to request files by email. Some of those files are big (not too >> big for email attachements). >> >> What I would like to have the user be able to do is to click on a file >> and have it emailed to him, but the user shouldn't have to wait for the >> emailing function to finish (tens of seconds some time) and continue >> browsing and clicking on other files to email or even leave the site >> confident that they'll receive the files in their email later. >> >> So I would like the emailing functionality to happen in the background >> and independent from the connection to the browser. >> >> Is this possible? Is it doable in PHP directly? > > Just an idea - if it sounds dumb just ignore me :) > > If nothing else works better. Instead of needing privileges do run > system scrips - couldn't you create a cron job for a PHP script that > sends emails to all records in a database? > > When the user clicks the link it simply adds their email address and > fiel to email to the database. When the cron job runs it sends out an > email with the files linked with it. > > just a quick thought > Mike i like this solution, but i cannot find the 'i like'-button ;) -- Luuk