Variable inc file

Hey guys, can’t say that I’m all that versed in php code but I’m wondering if it’s even possible to do what I want to do.

Basically I need the inserted .inc file to be variable based on the page ID (“TEAMID” below) … so if it’s id=15, I need the .inc file name “15.inc”.

When I put in the following, I get nothing but errors:

first try:
[php]<?php include '<?php echo $TEAMID; ?>.inc’;?>[/php]

second try:
[php]<?php include $TEAMID.'.inc';?>[/php]

Any suggestions/help would be much appreciated!

Hi there,

Try the following; you really weren’t that much off:

[php]<?php

$file = $TEAMID.’.inc’;
include($file);

?>[/php]

Hope this code helps.

Sponsor our Newsletter | Privacy Policy | Terms of Service