RE: [PHP-DB] How to write errorhandling??
| From: | Rick Emery | Date: | Mon, 22 Oct 2001 13:50:20 +0000 |
| Subject: | RE: [PHP-DB] How to write errorhandling?? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-13602@lists.php.net to get a copy of this message | ||
First, that "Failed to Connect" message looks like a database failure to
connect message; nothing to do with mail()
Second, are you REALLY trying to send header info at line 256? That's
pretty far down in a program. Usually, those decsions are made within the
first 10 to 20 lines.
So, is line 256 the mail() line? I suspect that you previously output some
text which would account for the "Warning: Cannot add header information -
headers already sent by..." message
Geben Sie uns mehr Information, bitte.
-----Original Message-----
From: Luditus [mailto:news.letters@gmx.de]
Sent: Sunday, October 21, 2001 5:45 AM
To: php-db@lists.php.net
Subject: [PHP-DB] How to write errorhandling??
Hi Folks,
I would like to send an mail via the mail function.
If the mail fails I would like to redirect to an errorpage. Currently my
code looks like this:
if ( mail($email,$subject_confirm_account, $message_confirm_account,
$from_confirm_account) ){
HEADER("Location:index.php?fuseaction=txt&msg=registered"); //success
}
else{
HEADER("Location:index.php?fuseaction=txt&msg=mailproblem"); // mail could
not been sent
};
Unfortunatelly I get an erromessage like that:
Warning: Failed to Connect in
e:\projects\globosapiens\07_production\actual\account\include\user.php on
line 256
Warning: Cannot add header information - headers already sent by (output
started at
e:\projects\globosapiens\07_production\actual\account\include\user.php:256)
in e:\projects\globosapiens\07_production\actual\account\include\user.php on
line 260
Where is the problem??? I can't see it.
Maybe one of you guys could help me out.
Thanx in advance,
Luditus
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net