Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

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.

Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...