Jump to content

mittu1

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mittu1's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. OK, I will go with the array solution. Excellent work guys. Thanks.
  2. phpchamps - that's worked now. Thank you so much. I will try to figure out where I was going wrong!
  3. Thanks guys for looking at this problem. phpchamps - your code produces the same problem I was having with mine. There are blank options after Balance and Infinity and I am at a loss as to where they are coming from. ToonMariner - your solution will work so I will use your array method. Many thanks again.
  4. Hi, I'm working on an ecommerce site at the moment and am looking at using Sage Pay Go http://www.sagepay.com/products_services/sage_pay_go for my payment gateway. I think you should realise that these type of gateways are quite expensive (monthly fees, SSL certificate required, internet merchant account) so if you might be better sticking with PayPal or Google Checkout. BTW, I'm in the UK. You can try Authorize.net if you're in the US. Also, doesn't your shopping cart have plugins for a payment gateway? Good luck.
  5. Hi All, Hopefully someone can point me in the right direction with this. I am new to PHP and am probably doing something obvious wrong so any help is much appreciated. This is for an eye prescription. I'm trying to fill a select statement with a while loop starting from -4 going to +4 in 0.25 increments. However at 0 I want the option to be Plano, followed by Balance and then Infinity before starting again at +0.25 on to +4. It all seems to work but the dropdown selection at Balance is followed by an option float(0.25) and then the Infinity option is followed by a float(0.5). I have no idea where these values are coming from. Please see the attached picture to see what I mean. Here is the code <select name="cstLeftcyl" type="text"> <?php $i=-4; while($i<=4.5) { if ($i == $cstLeftcyl) { ?> <option value="<?php echo ($i);?>" selected="selected"><?php switch ($i) { case 0: echo ("Plano"); ?></option><?php break; case 0.25: echo ("Balance"); ?><option><?php break; case 0.5: echo ("Infinity"); ?><option><?php break; case ($i<0): echo ($i); ?></option><?php break; default: echo ("+" . ($i-0.5)); ?></option><?php } } else { ?> <option value="<?php echo ($i);?>"><?php switch ($i) { case 0: echo ("Plano"); ?></option><?php break; case 0.25: echo ("Balance"); ?><option><?php break; case 0.5: echo ("Infinity"); ?><option><?php break; case ($i<0): echo ($i); ?></option><?php break; default: echo ("+" . ($i-0.5)); ?></option><?php } } $i=$i+0.25; } ?> </select> [attachment deleted by admin]
×
×
  • 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.