Jump to content

PHP syntax error. Can you help me?


TottoBennington

Recommended Posts

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';'

<?php
function paypal_items() {
 $num = 0;
 foreach($_SESSION as $name => $value){
     if($value != 0){
	     if (substr($name, 0, 5) == 'cart_') {
			 $id = substr($name, 5, strlen($name) -5);
			 $get = mysql_query('SELECT id, name, price, shipping FROM products WHERE id='.mysql_real_escape_string((int)$id));
			 while ($get_row = mysql_fetch_assoc($get)) {
			     $num++;
				 echo '<input type="hidden" name="item_number_'.$num'" value="'.$id.'" />';
				 echo '<input type="hidden" name="item_name_'.$num.'" value="'.$get_row['name'].'" />';
			     echo '<input type="hidden" name="amount_'.$num.'" value="'.$get_row['price'].'" />';
				 echo '<input type="hidden" name="shipping_'.$num.'" value="'.$get_row['shipping'].'" />';
				 echo '<input type="hidden" name="shipping2_'.$num.'" value="'.$get_row['shipping'].'" />';
			     echo '<input type="hidden" name="quantity_'.$num.'" value="'.$get_row['quantity'].'" />';
			 }
		 }
	 }

 }
}
?>

Link to comment
https://forums.phpfreaks.com/topic/257426-php-syntax-error-can-you-help-me/
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.