Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Parse error: syntax error, unexpected '<'


VasillyGifts

Recommended Posts

Posted

Hi

 

I've added some extra text for the products short description add-on and I'm now getting this error. I cannot see where the extra '<' is and whether I should be adding a '>' or removing the '<' I know it's in the following area. I'd appreciate any help.

 

 

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '"><b>' . $listing['products_name'] . '</a></b><br>' . $listing['short_desc'] . '</b>;

} else {

$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '"><b>' . $listing['products_name'] . '</a></b><br>' . $listing['short_desc'] . '</b>';

}

break;

 

Thanks!

Posted

Hi

 

I've added some extra text for the products short description add-on and I'm now getting this error. I cannot see where the extra '<' is and whether I should be adding a '>' or removing the '<' I know it's in the following area. I'd appreciate any help.

 

 

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '"><b>' . $listing['products_name'] . '</a></b><br>' . $listing['short_desc'] . '</b>;

} else {

$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '"><b>' . $listing['products_name'] . '</a></b><br>' . $listing['short_desc'] . '</b>';

}

break;

 

Thanks!

 

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '"><b>' . $listing['products_name'] . '</a></b><br>' . $listing['short_desc'] . '</b>';
} else {
$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '"><b>' . $listing['products_name'] . '</a></b><br>' . $listing['short_desc'] . '</b>';
}
break;

Posted

$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '"><b>' . $listing['products_name'] . '</a></b><br>' . $listing['short_desc'] . '</b>';
} else {
$lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '"><b>' . $listing['products_name'] . '</a></b><br>' . $listing['short_desc'] . '</b>';
}
break;

 

 

Thanks for that. However, I'm now getting the following error

 

Parse error: syntax error, unexpected T_STRING based on the same text. Any help will be greatly appreciated.

 

Thanks

Posted

Thanks for that. However, I'm now getting the following error

 

Parse error: syntax error, unexpected T_STRING based on the same text. Any help will be greatly appreciated.

 

Thanks

 

No there's nothing wrong with the code I posted, must be something else.

Posted

It's not a PHP error, but you do have your HTML tag nesting screwed up. You have

<a href="a URL"><b>link text</a></b><br>short desc</b>

I suspect you want something like

<a href="a URL"><b>link text</b></a><br>short desc<br>

 

You're also missing a closing ' at the end of the first line (fixed here):

if (...) {
 $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 
                                        'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . 
                                        '&products_id=' . $listing['products_id']) . 
            '"><b>' . $listing['products_name'] . '</b></a><br>' . $listing['short_desc'] . '<br>';
} else {
 $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 
                                         'products_id=' . $listing['products_id']) . 
            '"><b>' . $listing['products_name'] . '</b></a><br>' . $listing['short_desc'] . '<br>';

}

Posted

It was the closing ' that I had missed out. I have just noticed that FWR had corrected this in their first reply. Sorry for the confusion. Thanks to both of you for your help!

Archived

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

×
×
  • Create New...