php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29003 function executes continuosly if placed in an if statement
Submitted: 2004-07-03 21:41 UTC Modified: 2005-01-19 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: admin at host-net dot org Assigned:
Status: No Feedback Package: Mail related
PHP Version: 4.3.7 OS: Windows 2000 Server
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: admin at host-net dot org
New email:
PHP Version: OS:

 

 [2004-07-03 21:41 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-03 22:04 UTC] admin at host-net dot org
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");
}
 [2004-07-11 20:20 UTC] sniper@php.net
I can not reproduce this. Have you made any changes to your php.ini compared to php.ini-dist from the distribution package? 

 [2004-07-11 22:24 UTC] admin at host-net dot org
The only changes I have made to the php.ini are as follows:

register_globals = on
extension_dir = "C:/winnt/system32"
upload_tmp_dir = C:\PHP\uploadtemp 
SMTP = localhost
smtp_port = 25
sendmail_from = admin[at]host-net.org

The code works perfectly if session_start() is not included.
 [2004-07-20 08:18 UTC] admin at host-net dot org
No luck.  I tried the snapshot and I got the same error.  I noticed that version 5 was out so I upgraded to that and even then it didn't work.
 [2005-01-19 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 17:01:30 2024 UTC