FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » time consuming loop
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: time consuming loop [message #170884 is a reply to message #170881] Sun, 05 December 2010 00:56 Go to previous messageGo to previous message
paulfredlein is currently offline  paulfredlein
Messages: 8
Registered: December 2010
Karma:
Junior Member
Hi,

I'm trying to automate the emailing of my newsletter to my contact
group.

In php, I'm thinking of using an arrary of email addresses derived from
a mysql contact list. Then looping through the array emailing each item
with my newsletter.

Originally, I played with this inside a mysql query and delaying each
email by a second so that the host server doesn't think I'm a spammer.
But then the calling php inside my browser just waited and became
'unresponsive'.

So then I thought of the array of email addresses and wondered if
there's a thread or callback mechanism I can use. Or perhaps I can keep
track of a progress variable and use a smaller loop initializing a loop
with the progress variable which is the index into the array - or
something.

To send the newsletter, I just open that php page in my browser and
enter a password and away it goes.

I'm sure this is not the proper way to do this but it's only for my use
and not a commercial product or anythng like that.

Thanks,

Paul


Twayne <nobody(at)devnull(dot)spamcop(dot)net> wrote:

> In news:1jszks5.1v6hzcuelpu9sN%paulfredlein(at)optusnet(dot)com(dot)au,
> Paul Fredlein <paulfredlein(at)optusnet(dot)com(dot)au> typed:
>> Hi,
>>
>> If I use a loop that's too time consuming the browser will
>> complain. Is there a callback or threads or something I can
>> use and only do a small number each time instead of the
>> whole lot at once?
>>
>> for(short i = 0; i < LONG_INT; i++)
>> {
>> doSomething();
>> }
>>
>> Thanks,
>>
>> Paul
>
> Perhaps you should describe what you're trying to do. I know if I ran into a
> web page that timed out I'd probably already be long gone and not return.
> More info would help.
> HTH,
>
> Twayne`
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Demo PHP/Ajax slideshow server crashing
Next Topic: Apache + PHP module segfaults
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 18:41:18 GMT 2024

Total time taken to generate the page: 0.04657 seconds