Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Syntax error


Guest

Recommended Posts

Hi There,

 

I want to include a header.php based on the category id... in my code on the product.php page I have this:

 

<?php require(DIR_WS_INCLUDES '.'$category_id''".php")?>

 

However how do I get is so if the category id is 21 that it includes the header file 21.php

 

I am very new to PHP

 

Thanks

Link to comment
Share on other sites

That should be

<?php require(DIR_WS_INCLUDES ' . $category_id . '.php')?>

If the category_id is 21, that should include 21.php (assuming includes/21.php exists).

 

Good luck,

Matt

Link to comment
Share on other sites

Hi Matt,

 

tried that and got the error:

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING

 

Thank you for your help

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...