From 0bf8233e0ef1db60e09269db5a2372fdd67f290d Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sat, 23 Jun 2007 19:14:58 +0200 Subject: NEW FEATURE: added admin name and email address to be configurable email and name can be defined in config.php. Errors are send to that email address. --- functions.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'functions.php') diff --git a/functions.php b/functions.php index be88974..7ee180e 100644 --- a/functions.php +++ b/functions.php @@ -28,7 +28,7 @@ function myisset() /* returns 1 if all names passed as args are defined by a GET or POST statement, * else return 0 */ - + $ok = 1; $args = func_get_args(); @@ -41,10 +41,17 @@ function myisset() return $ok; } +function myerror($message) +{ + echo "".htmlspecialchars($message)."\n"; + mymail($ADMIN_EMAIL,$EmailName." Error in Code",$message); + return; +} + function pos_array($c,$arr) { $ret = 0; - + $i = 0; foreach($arr as $a) { @@ -335,7 +342,8 @@ function card_value($card) case 48: return 0; default: - echo "something went wrong, please contact the admin. ErrorCode: 2 - $card
"; + myerror("something went wrong, please contact $ADMIN_NAME at $ADMIN_EMAIL. ErrorCode: 2 - $card
"); + echo "something went wrong, please contact $ADMIN_NAME at $ADMIN_EMAIL. ErrorCode: 2 - $card
"; return 0; } } -- cgit v1.2.3-18-g5258