Jump to content

Syntax Error


Kitsun3

Recommended Posts

[code    	<?
		if(is_array($_SESSION['cart'])){
            	echo '<tr bgcolor="#003366" style="font-weight:bold; color: #FFF;"><td class="carthead">Name</td><td class="carthead">Price</td><td class="carthead">Qty</td><td class="carthead">Amount</td><td class="carthead">Options</td></tr>';
			$max=count($_SESSION['cart']);
			for($i=0;$i<$max;$i++){
				$pid=$_SESSION['cart'][$i]['productid'];
				$q=$_SESSION['cart'][$i]['qty'];
				$pname=get_product_name($pid);
				$sku=get_sku($pid);
				if($q==0) continue;

				mysql_connect ('localhost', 'something', 'somepass') ;
				mysql_select_db ('somedata_merch');

				$sql1 = "SELECT * FROM items WHERE sku='$sku' ";

				$result1 = mysql_query($sql1) or print ("Can't select entries from table.<br />" . $sql1 . mysql_error());

				while($row1 = mysql_fetch_array($result1)) {

					$color1  = stripslashes($row1['color1']);
					$color2  = stripslashes($row1['color2']);
					$color3  = stripslashes($row1['color3']);
					$color4  = stripslashes($row1['color4']);

		?>
            		<tr bgcolor="#FFFFFF">
                    <td class="cart" width="250px"><?=$pname?></td>
                    <td class="cart" width="100px">$ <?=get_price($pid)?></td>
                    <td class="cart" width="60px"><input type="text" name="product<?=$pid?>" value="<?=$q?>" maxlength="3" size="2" /></td>               
                    <td class="cart" width="100px">$ <?=get_price($pid)*$q?></td>
                    <td class="cart" width="100px">
                  <select name="jumpMenu2" id="jumpMenu2" onchange="MM_jumpMenu('parent',this,0)">
                    <option value="#"><?php echo $color; ?></option>
                    <option value="shoppingcart.php?color=<?=$color1?>"><?=$color1?></option>
                    <option value="shoppingcart.php?color=<?=$color2?>"><?=$color2?></option>
                    <option value="shoppingcart.php?color=<?=$color3?>"><?=$color3?></option>
                    <option value="shoppingcart.php?color=<?=$color4?>"><?=$color4?></option>
                  </select>
                  </td>
                    <td class="cart" width="60px" align="center">
                    <a href="javascript:del(<?=$pid?>)">
                    <img src="delete.png" width="30px" height="30px" border="0" alt="remove item" />
                    </a>
                    </td>
                    </tr>
            <?	

			}
		?>
			<tr><td><b style="margin-left: 5px;">Order Total: $<?=get_order_total()?></b></td><td colspan="5" align="right"><input type="button" value="Clear Cart" onclick="clear_cart()"><input type="button" value="Update Cart" onclick="update_cart()"><input type="button" value="Place Order" onclick="window.location='direct_post.php'"></td></tr>
		<?  }else{

			echo "<tr bgColor='#FFFFFF'><td>There are no items in your shopping cart!</td>";

		}
	?>
        

 

I am currently getting this error.

 

Parse error: syntax error, unexpected T_ELSE in /../../../shoppingcart.php on line 178.

 

Please help.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.