Question

Im having a little problem and cant get it to resolved for some reason. I have built a website and got it running but i have now passed some of the files over to a folder to build more themes. What i am doing is trying to change themes back end and for this instance i will use the theme "smooth"

this is what i have, if i put this:

<?php
include "config_inc.php";
?>
include "themes/<?=$aset['Theme']?>/index.php]";

it will display on the page as the correct path "themes/smooth/index.php" so i know it is connecting to the database correctly. But now if i put it in this format:

<?php
include "config_inc.php";
?>
<?php
include "themes/<?=$aset['Theme']?>/index.php]";
?>

It just shows a blank page. I have tested the link as in "my_domain/themes/smooth/index.php" and every is displaying correctly

Hope someone can help. Thanks

Was it helpful?

Solution

You shouldn't use php tags inside php tags to insert variable in string. Just use {} to do it:

include "themes/{$aset['Theme']}/index.php";

Or

include 'themes/' . $aset['Theme'] . '/index.php';
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top