franco.pentangeli Posted January 13, 2012 Share Posted January 13, 2012 Hi, I need to use require or include functions into tpl files. I have already change PHP_TAGS to true and $php_handling to PHP_ALLOW, but I obtain this error: Fatal error: require() [function.require]: Failed opening required 'http://********.com/themes/myriam/prova.php' (include_path='.:/usr/lib64/php/pear/PEAR:/usr/lib64/php:/usr/share/pear') in /var/www/*************/tools/smarty/plugins/block.php.php(23) : eval()'d code on line 2 why? can you help me? thanks! F Link to comment Share on other sites More sharing options...
franco.pentangeli Posted January 13, 2012 Author Share Posted January 13, 2012 please help! Link to comment Share on other sites More sharing options...
puecher Posted January 14, 2012 Share Posted January 14, 2012 Hi, open config/smarty.config.inc.php and add $smarty->allow_php_tag = true; after $smarty->deprecation_notices = false; Now you can use PHP Tags like <?php include 'functions.php'; ?>. Cheers Link to comment Share on other sites More sharing options...
franco.pentangeli Posted January 16, 2012 Author Share Posted January 16, 2012 Hi, open config/smarty.config.inc.php and add $smarty->allow_php_tag = true; after $smarty->deprecation_notices = false; Now you can use PHP Tags like <?php include 'functions.php'; ?>. Cheers Hi! thanks for help! I add your code into config/smarty.config.inc.php but I obtain the same error... [/size][/font][/color] Fatal error: require() [function.require]: Failed opening required 'http://*******/themes/mio/prova.php' (include_path='.:/usr/lib64/php/pear/PEAR:/usr/lib64/php:/usr/share/pear') in /var/www/***********/tools/smarty/compile/98492ccaf869414691e5bfefe8f6a983b9fedc42.file.authentication.tpl.php on line 130 can you help me?? Link to comment Share on other sites More sharing options...
justinl Posted January 16, 2012 Share Posted January 16, 2012 It would appear that you're not giving the require function the correct path. I believe you need to use a relative path to you file based on the actual file system, not a web address. It cannot be "http://www.example.com/myphpfile.php". It would have to be something like "/myphpfile.php" or "classes/myphpfile.php". Link to comment Share on other sites More sharing options...
franco.pentangeli Posted January 16, 2012 Author Share Posted January 16, 2012 It would appear that you're not giving the require function the correct path. I believe you need to use a relative path to you file based on the actual file system, not a web address. It cannot be "http://www.example.com/myphpfile.php". It would have to be something like "/myphpfile.php" or "classes/myphpfile.php". Perfect! thank you very much!!! Link to comment Share on other sites More sharing options...
lettersets Posted March 14, 2012 Share Posted March 14, 2012 I have already change PHP_TAGS to true and $php_handling to PHP_ALLOW, but I obtain this error: Hi, I'm also trying to use php include on my website and am browsing the forum for instructions. I managed to find "$php_handling" in the tools/smarty/Smarty.class.php file, but where do I find the PHP_TAGS option? Thanks for your help, Michelle Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now