Quote:
Originally Posted by Fou-Lu
It depends on what you are referring to as security. Using a defined constant will potentially create a privacy leak between scripts as it will be globally readable in any scope. That's only a problem if you say its a problem; given constant's readonly nature, I'd say there's no problem with that. You wouldn't want to create a defined constant for authentication information if you allow third party addons, but I don't see an issue with an email address (unless you're concerned about spam).
Email headers should be dynamically and conditionally created within the script handling all the emails. These aren't configuration based data, they are manipulation based on data, so creating a global location for them doesn't make any sense.
|
Right now I have a script called "results.php" which is where I display my Error-Messages and where I log and send out e-mail notifications to the Admin.
I tweaked my code a bit and added these variables to my script to make it slightly easier to modify...
PHP Code:
// ************************
// Initialize Variables. *
// ************************
$emailTo = 'JoeTheAdmin@mail.com';
$headers = "From: Admin <admin@MySite.com>\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
I guess I was wondering if those should be assigned to Constants, and maybe go into a global "config" file instead?!
Or are they okay like they are? (Of course, if I need to refer to the Admin E-mail in other scripts, then I'd have a maintenance issue...)
Debbie