Jump to content

help with this coding


jk14

Recommended Posts

hi a new to php, so here is my problem;

<?=$col?>">HKD $<?=$recSubscription['subscription_amount']?><br>[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]USD $<?php echo ($recSubscription['subscription_amount'] == 149) ? '20.00' : '27.00'; ?>[!--colorc--][/span][!--/colorc--]

I would like to add a third number for the USD currency but everytime i enter a number the page wont load.

How can i add '34' together with '20.00' : '27.00';

cheers guys
Link to comment
https://forums.phpfreaks.com/topic/10781-help-with-this-coding/
Share on other sites

[!--quoteo(post=378440:date=May 30 2006, 12:24 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ May 30 2006, 12:24 PM) [snapback]378440[/snapback][/div][div class=\'quotemain\'][!--quotec--]
This syntax means:
If $recSubscription['subscription_amount'] is 149 it echos USD $20.00
Else, USD $27.00

This is a bit weird. Why would you want to add a third number?
[/quote]

there is two prices, but i would like to add a third.

how can i?
Link to comment
https://forums.phpfreaks.com/topic/10781-help-with-this-coding/#findComment-40313
Share on other sites

I dont think wha you are trying to do quite makes sense at the moment...

As it stands, if the subscription_amount is equal to 149, it displays $20 and if not, it displays $27

You would need some other condition to have three possible outputs:
if ($recSubscription['subscription_amount'] == 149){
echo "<br>USD $20.00";
}elseif(some other condition){
echo "<br>USD $27.00";
}else{
echo "<br>USD $34.00";
}
Link to comment
https://forums.phpfreaks.com/topic/10781-help-with-this-coding/#findComment-40359
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.