[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [kDev] PHP gurus: quick fix coding question...
On Mon, 2003-05-19 at 09:53, Daniel Harris wrote:
> WARNING: This email is intended for PHP coders only...
>
> This question is about how to run PHP code without having to call a web
> page whilst passing it arguments like a perl cgi script.
>
> When I send out the newsletter I currently use zspamall.php. It allows
> me to select a group of Kendra Participants and then cycles through
> them sending a personalised email to each. But as the list of
> participants grows so does the risk of a page timeout. It seems like
> it's the sending-of-the-email that introduces a sizeable delay. I need
> a quick and dirty fix. See:
>
> http://www.kendra.org.uk/develop-
> code.php?page=%2Fzspamall.php&dowhat=Show+Source
>
> All I want to do is replace the line:
>
> mail($email,$subject,$message,"From: kendraNews <k@xxxxxxxxxxxxx>");
>
> with a call to a script.
>
> Oh, no, just thought... Will zspamall.php wait for a return from the
> cgi script? In which case nothing will be gained and we'll need to put
> the whole loop into the cgi script.
>
> Ideas anyone? Code anyone?
>
> Cheers Daniel
>
You need to write a wrapper, which does a fork/exec/setsid, dissociating
from the parent process entirely. I've run into this minor problem
before, it's a pain.
I can knock one together for you if you like, but I'd essentially have
to do it by porting the zspamall.php script to Perl or something - I
don't think PHP has this kind of support in it.
Dave.