Re: PhP 4.2.1 (and various)

From: Date: Wed, 15 May 2002 10:33:52 +0000
Subject: Re: PhP 4.2.1 (and various)
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-97687@lists.php.net to get a copy of this message
On Wed, 15 May 2002 08:52:49 +0200, Analysis & Solutions wrote: >> So my question is, why has that changed, and what do we do now to >> authenticate users and redirect them to anothe page? And what the hell >> is this "@" thingy, i cant see to find anything on it in the manual, >> and search doesnt work for chars like that. > > The @ represses error messages. For example: > mail('', 'subject', 'body'); > will produce an error message, that the to address is bad, while > @mail('', 'subject', 'body'); > will silently fail. > > Rather than doing that, it's better to write your code so that there > won't be error messages in the first place. Not only that: if you are running a production server, you will probably want to log your error messages to a file (or syslog, or whatever), instead of printing them. So 'display_errors' should be off. If that is the case, you don't need to use @ anymore, because there will be no HTML output even in case of problems. The advantage of this is that you can use the exact same code on a development server (with display_errors = on) and a production server. Vincent

« previous php.general (#97687) next »