HI,
I am now using a development server to copy my live site to this development server including the database for the purpose of migrating joomla 2.x to 3.x. I want to assure it is working before copying back to live site.
I backed up the chronoforms on live site and restored back to the development site, and seems restoring ok. However, when i run a registration form, it gives me some db insert error to the coupon table. It said duplicate record of inserting blank record.
I have the following server side scripts to validate the coupon code entered, and i make sure the following scripts would be running only if coupon_code entered on the form is not EMPTY. However, it seems that the script is still running even if the form data is EMPTY. Is there anything wrong or DB Save is wrong here? I also attached my DB Save configuration.
I am now using a development server to copy my live site to this development server including the database for the purpose of migrating joomla 2.x to 3.x. I want to assure it is working before copying back to live site.
I backed up the chronoforms on live site and restored back to the development site, and seems restoring ok. However, when i run a registration form, it gives me some db insert error to the coupon table. It said duplicate record of inserting blank record.
I have the following server side scripts to validate the coupon code entered, and i make sure the following scripts would be running only if coupon_code entered on the form is not EMPTY. However, it seems that the script is still running even if the form data is EMPTY. Is there anything wrong or DB Save is wrong here? I also attached my DB Save configuration.
<?php
if (!empty($form->data['coupon_code']))
{
$form->data['coupon_type'] = $form->data['coup']['coupon_type'];
$form->data['coupon_times'] = $form->data['coup']['coupon_times'];
$form->data['coupon_expiry'] = $form->data['coup']['coupon_expiry'];
$form->data['coupon_id'] = $form->data['coup']['coupon_id'];
$form->data['reseller_id'] = $form->data['coup']['coupon_rid'];
$form->data['todaydate'] = date('Y-m-d');
if (($form->data['coupon_type']) == "T"){
if (($form->data['coupon_times']) <= 0 ) {
return false;
}
else
{
$form->data['coupon_times'] = $form->data['coupon_times'] - 1 ;
}
}
if (($form->data['coupon_type']) == "D"){
if (($form->data['coupon_expiry']) < $form->data['todaydate']) {
return false;
}
}
}
?>