Guest Posted November 20, 2004 Posted November 20, 2004 As a complete neophyte this problem confounds me? :blink: Everything is working from the user side but when I go to admin I get this error: Fatal error: Cannot redeclare create_coupon_code() (previously declared in /home/lbankson/public_html/admin/includes/add_ccgvdc_application_top.php:25) in /home/lbankson/public_html/admin/includes/add_ccgvdc_application_top.php on line 25 Line 25 and on is: function create_coupon_code($salt="secret", $length=SECURITY_CODE_LENGTH) { $ccid = md5(uniqid("","salt")); $ccid .= md5(uniqid("","salt")); $ccid .= md5(uniqid("","salt")); $ccid .= md5(uniqid("","salt")); srand((double)microtime()*1000000); // seed the random number generator $random_start = @rand(0, (128-$length)); $good_result = 0; while ($good_result == 0) { $id1=substr($ccid, $random_start,$length); $query = tep_db_query("select coupon_code from " . TABLE_COUPONS . " where coupon_code = '" . $id1 . "'"); if (tep_db_num_rows($query) == 0) $good_result = 1; } return $id1; } Any help on this would be most appreciated. Quote
Guest Posted November 20, 2004 Posted November 20, 2004 Ok, never mind, I figured it out. I just commented out line 25 etc. in the file. If you get more than one of these errors rinse and repeat. It works now. :D Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.