• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Php code Switch default doesn't work

Php code Switch default doesn't work 5 years 4 months ago #38596

  • nino59
  • nino59's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 25
  • Thank you received: 1
Hi,

I made a simple rsform coupon code with 1 text field.
When user type a coupon and submit rsform, there is a SELECT CASE code to redirect user to appropriate joomla article.
This is the PHP code on Script called on form process:
$v_coupon = $_POST['form']['coupon'];
 
 
switch ($v_coupon) {
    case "PROMO2018":
		$app = JFactory::getApplication();
	$app->redirect('index.php?option=com_content&view=article&id=165&Itemid=483');
 
    case "ETUDIANTBDX":
		$app = JFactory::getApplication();
	$app->redirect('index.php?option=com_content&view=article&id=15&Itemid=229');
 
   default:
 
		echo "<script type='text/javascript'>alert('Le code PROMO n'est pas bon! Veuillez essayer un autre svp.');</script>";	
 
        break;
}

The 2 firs case works fine. The default case doesn't work. i don't see error message when user type wrong coupon code.

Can someone help me please?
Last Edit: 5 years 4 months ago by nino59.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!