Page 1 of 1

Smarty seems to expand tags in header **'use_smarty_php_tags is enabled **

Posted: Fri May 09, 2008 6:49 am
by DavidOlsen192
My template includes {php}require_once('includes/db_config.inc.php'); {/php}
but the html produced has the contents of the db_config.inc.php file displayed.  It doesn't interpret the PHP.

Any help will be appreciated.

Thanks,
Dave

I get the following at the beginning of the web page:
<?
//Troubleshooting:
//echo "This is the config file";

//---------------------------------------------
//---------------------------------------------
//Set the variables below for each site:

//Choose the includes directory for the CMS
$includesPath = "/home/kris/includes/";

//Choose a default language by commenting and uncommenting:
$defaultLang  = "eng";
//$defaultLang  = "jap";

//Setup the database connection

Re: Smarty seems to expand tags in header but php is not executed

Posted: Fri May 09, 2008 2:27 pm
by rvdv
A quote from the developers documentation:
To enable this functionality, you need to change one line of the config.php file in your installation. Change the "use_smarty_php_tags" setting to true. i.e.:

  #Allow smarty {php} tags?  These could be dangerous if you don't trust your users.
  $config['use_smarty_php_tags'] = true;

Re: Smarty seems to expand tags in header but php is not executed

Posted: Fri May 09, 2008 4:11 pm
by DavidOlsen192
Sorry, I thought I mentioned that (it was late).  Smarty tags are turned on in config.php. I am using php 5.1.6 on a CentOS 4.6 server.  I don't have root.

Is there a simple way to test that Smarty is actually working?

If I have the flag enabled but am still having this problem is it a fairly sure thing that I have Smarty misconfigured?

I am moving a website from one server to another and have never used Smarty or CMS so I am dealing with a learning curve.

Thanks,
Dave