[PHP-DB] Infinite Loop?

2002-11-02 Thread Graeme McLaren
Greetings list members.  I've written the code below as part of an
automatic email script.  The problem with this is it seems to run in to
an infinite loop.  The for loop seems to get completely ignored by
emails get sent constantly.  I deleted the script after receiving 2500
emails ! :'( 

Can anyone point out what the problem with this is?


while($tmp = $NowUnix)
{

for($i=0; $i=2; $i++)
{
$sendto = [EMAIL PROTECTED];
$subject = Test Automatic Email;
$message = If you get this then age3.php works
$message = If you get this then age3.php works
$message = If you get this then age3.php works;

mail($sendto, $subject, $message);
}
}


Cheers,

Graeme :)


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




Re: [PHP-DB] Infinite Loop?

2002-11-02 Thread Tony S. Wu
I've seen no way to get out of the while loop.

Tony S. Wu
[EMAIL PROTECTED]

Nope, this world ain't perfect. But at least I know it's not because of
me.


Graeme McLaren at [EMAIL PROTECTED] wrote:

 Greetings list members.  I've written the code below as part of an
 automatic email script.  The problem with this is it seems to run in to
 an infinite loop.  The for loop seems to get completely ignored by
 emails get sent constantly.  I deleted the script after receiving 2500
 emails ! :'( 
 
 Can anyone point out what the problem with this is?
 
 while($tmp = $NowUnix)
 {
 
 for($i=0; $i=2; $i++)
 {
 $sendto = [EMAIL PROTECTED];
 $subject = Test Automatic Email;
 $message = If you get this then age3.php works
 $message = If you get this then age3.php works
 $message = If you get this then age3.php works;
 
 mail($sendto, $subject, $message);
 }
 }
 
 Cheers,
 
 Graeme :)




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




Re: [PHP-DB] Infinite Loop?

2002-11-02 Thread Jason Wong
On Sunday 03 November 2002 04:26, Graeme McLaren wrote:
 Greetings list members.  I've written the code below as part of an
 automatic email script.  The problem with this is it seems to run in to
 an infinite loop.  The for loop seems to get completely ignored by
 emails get sent constantly.  I deleted the script after receiving 2500
 emails ! :'(

 Can anyone point out what the problem with this is?


 while($tmp = $NowUnix)

You're not updating $tmp or $NowUnix inside your loop.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
Time is an illusion perpetrated by the manufacturers of space.
*/


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




Re: [PHP-DB] Infinite Loop?

2002-11-02 Thread Graeme McLaren
Ah right, I thought that once the while loop condition is true it would
execute the for loop then quit once the for loop had reached its
condition.  But really, whats happening is the while loop is continuing
to run the for loop and then run through the while loop again.  Ok I've
got it now.  

Thanks for your advice.


Graeme :)

On Sat, 2002-11-02 at 20:41, Jason Wong wrote:
 On Sunday 03 November 2002 04:26, Graeme McLaren wrote:
  Greetings list members.  I've written the code below as part of an
  automatic email script.  The problem with this is it seems to run in to
  an infinite loop.  The for loop seems to get completely ignored by
  emails get sent constantly.  I deleted the script after receiving 2500
  emails ! :'(
 
  Can anyone point out what the problem with this is?
 
 
  while($tmp = $NowUnix)
 
 You're not updating $tmp or $NowUnix inside your loop.
 
 -- 
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 
 
 /*
 Time is an illusion perpetrated by the manufacturers of space.
 */
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 



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