I got home late tonight, so this will be short for now...
Originally Posted by firepages
honestly, I think you are going to have to do a search on your codebase .. (grep -r 'resultsCode' /path/to/www (or find in files in windows)) and anything that is actually an error change to `errorCode` , then in your results script check if `errorCode` or `resultsCode` has been passed and act accordingly, I assume you probably just need to check for that at the sending email stage ?
[The alternative would be to add some flag in the value of resultsCode indicating and error or a message but this is probably more work and still requires editing lots of files?]
I cant think of anything off of the top of my head that is ging to be an easier way out since the problem is in lots of places whichever way you go about fixing it?
Today at work, this is what I came up with for a quick solution...
I could assume that all "results" are "Errors", and therefore need both Logging and an Email.
Then in my "results.php" code, I could make the above assumption the "default" behavior.
Then in any code where I am just displaying an "outcome" that is NOT an "error", I could add this...
I could add this...
$_SESSION['isEmailable'] = FALSE;
Somewhere in "results.php", I would assume that normally....
$_SESSION['isEmailable'] = TRUE;
...but in case where it is FALSE, then take a different action.
(This made sense in my head today at work. Not sure how articulate I'm being right before bedtime?!)
your switch is a bit long winded and probably you would be better off searching an array of error codes ? not that it really matters either way.
Each Error-Message is *customized*. (Although some day, I'm sure I can condense things down into "10 Flavors of Errors"?!)
That being said, how would an array solve anything?