#29003 [Opn]: function executes continuosly if placed in an if statement

From: Date: Sat, 03 Jul 2004 20:04:51 +0000
Subject: #29003 [Opn]: function executes continuosly if placed in an if statement
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-61647@lists.php.net to get a copy of this message
 ID:               29003
 User updated by:  admin at host-net dot org
 Reported By:      admin at host-net dot org
 Status:           Open
 Bug Type:         Mail related
 Operating System: Windows 2000 Server
 PHP Version:      4.3.7
 New Comment:

I forgot to add that the session_start() function has to be at the top
of the code.  

session_start();
$testnum = 5;
if($testnum == 5) {
$memail = 'mymail@test.com';
mail('tester@test.com',
	 'The subject is: test',
	 'Hello, this is a test',
	 "From: $memail\r\nReply-to: $memail\r\n");
}


Previous Comments:
------------------------------------------------------------------------

[2004-07-03 21:41:28] admin at host-net dot org

Description:
------------
When I place the mail function within an if statement, it runs until
the maximum execution time is exceeded.  When I take the if statement
out, it runs perfectly.

Reproduce code:
---------------
$testnum = 5;
if($testnum == 5) {
$memail = 'mymail@test.com';
mail('tester@test.com',
	 'The subject is: test',
	 'Hello, this is a test',
	 "From: $memail\r\nReply-to: $memail\r\n");
}

Expected result:
----------------
The code should run through the if statement and send the E-mail if the
statement is true.

Actual result:
--------------
Fatal error: Maximum execution time of 30 seconds exceeded in
c:\server\webserver\host-net\secure\login\success\makechanges\email.php


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=29003&edit=1


Thread (8 messages)

« previous php.bugs (#61647) next »