ID: 16516
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
-Status: Open
+Status: Bogus
Bug Type: Mail related
Operating System: FreeBSD 4.4
PHP Version: 4.1.2
New Comment:
Can't work unless you include config.php somewhere.
Previous Comments:
------------------------------------------------------------------------
[2002-04-09 16:29:16] [EMAIL PROTECTED]
Sorry, can't backtrace on my server!
But it's really reproducible!
so here's the set of files:
send.php:
<?
include("func.php");
sendmail();
?>
func.php:
<?
function sendmail(){
global $mailto;
mail($mailto, "Subject", "Body", "From: [EMAIL PROTECTED]");
}
?>
config.php:
<?
$mailto="[EMAIL PROTECTED]";
?>
Just put this 3 files on a server in the same directory, and start
"send.php" in your browser.
It shouldn't work.
------------------------------------------------------------------------
[2002-04-09 13:55:26] [EMAIL PROTECTED]
To properly diagnose this bug, we need a backtrace to see what is
happening behind the scenes. To find out how to generate a backtrace,
please read http://bugs.php.net/bugs-generating-backtrace.php
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open".
------------------------------------------------------------------------
[2002-04-09 12:50:57] [EMAIL PROTECTED]
I got 3 files, part of an eShop:
config.php // contains $mailto
func.php // contains sendmail();
send.php // calls sendmail();
OK, the problem was, I execute send.php:
<?
include("config.php");
include("func.php");
sendmail();
//now HTML-code
?>
sendmail() contains:
<?
function sendmail(){
global $mailto; //and other vars
//now last line
mail($mailto, "Any subject", $body, "From: [EMAIL PROTECTED]");
}
?>
Now, PHP crashed without a reason, server error page appears, nothing
wrote to the error.log!
I changed the mail-function in:
mail("[EMAIL PROTECTED]", "Any subject", $body, "From:
[EMAIL PROTECTED]");
Now it worked fine!
Dunno if its a bug, but it was difficult to catch the error!
Apache Server, tested with PHP 4.0.6 and 4.1.2
(err, sorry 4 bad english)
greets,
Lopez
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16516&edit=1