Page 1 of 1

Help me with my parse error...please!

Posted: Fri Aug 26, 2005 4:01 am
by hessodreamy
Have hit a big brick wall on this one. I'm NOT that much of a newbie but really cannot find why this bit of code gives a parse error.

When in the main script I get a 'expecting T_STRING or T_VARIABLE or T_NUM_STRING' message.
When running the culprit block of code on its own i get 'parse error' one line after the end of the code.
I must have left something unclosed, but really can not see where. Please help before I go insane!
Ta

Code: Select all

<? if($showPrice) {

                            if($clearanceItem)
                            {
                              ?>
                              <b><font size = 2>Normal Price: £<?=curFormat($normalPrice)?></font></b>
 								 	<small>£<?=curFormat($normalPrice * ($tax+1))?> inc VAT </small>
									<br>

								  <b><font size = 2>Discounted price : £<?=curFormat($onlinePrice)?></font></b>
								  <small>£<?=curFormat($OnlineVATprice)?> inc VAT </small>
								  <br>
								  <b><font size = 2 color = "RED">YOU SAVE : £<?= curFormat($normalPrice - $onlinePrice)?></font></b>
								  <? if($subid==371){?><input type="hidden" name="discounted" value="true"><?}
                          }

                        elseif($saleItem)
                        {?>
                          <b><font size = 2>Normal Price: £<?= curFormat($originalPrice)?></font></b>
 								 	<small>£<?=curFormat($orignalPrice * ($tax+1))?> inc VAT </small>
									<br>

								  <b><font size = 2>Discounted price : £<?= curFormat($usePrice)?></font></b>
								  <small>£<?=curFormat($usePrice * ($tax+1))?> inc VAT </small>
								  <br>
								  <b><font size = 2 color = "RED">YOU SAVE : £<?= curFormat($originalPrice - $usePrice)?></font></b>
								  <? if($subid==1475){?><input type="hidden" name="saleItem" value="true"><?}

    `                   }


					     elseif(!$dvd)
							  {
								?>
							  <b><font size = 2>Normal Price: £<?=curFormat($usePrice)?></font></b>
							 	<small>£<?=curFormat($VATprice)?> inc VAT </small>
								<br>

							  <b><font size = 2 color = "RED">Buy Online For: £<?=curFormat($onlinePrice)?></font></b>
							  <small>£<?=curFormat($OnlineVATprice)?> inc VAT </small>
								  <?
								}

                         }
else {?>
<span style="color:blue; font-style:italic; font-size:2">Call for price - 01977 552000</span>
<? } ?>

Posted: Fri Aug 26, 2005 4:14 am
by JayBird
I have just run you code on my local machine and didnt get any parse errors, although i did clean up your code, becuase your code format and layout was nothing short of atrocious. 8)

Posted: Fri Aug 26, 2005 7:15 am
by feyd
there's a backtick in the middle of the code whitespace on the left lower area.... just befrore where all the code turns blue... that's a good hint.

Posted: Fri Aug 26, 2005 7:19 am
by hessodreamy
Yep. That's the bunny.
My editor doesn't pick up the backtick in its syntax highlighting, so it wasn't until I posted it that I saw the blue code.
I hadn't noticed the backtick myself cos I thought it was a speck on my screen!!

oooh dear... Just goes to show what happens if you stare at a screen for too long!