xeqution Posted June 24, 2007 Share Posted June 24, 2007 Hi, I am currently trying to integrate the following PHP code into header.tpl: ###################################################### <?php require_once("includes/global.php"); ?> ###################################################### <?php if ((!isset($_GET['pid'])) && (!isset($_POST['pid']))){ define("pid","1"); }else { if (isset($_GET['pid']) && !isset($_GET['option'])){ define("pid",$_GET['pid']); }elseif(isset($_GET['pid']) && isset($_GET['option'])) { define("pid",$_GET['pid']); define("option",$_GET['option']); }else{ define("pid",$_POST['pid']); } } ?> ###################################################### After reading around, I have found that adding php code to a smarty template isn't a recommended solution. I am very confused as how I should go about parsing php through a smarty template file. I am not looking for a "quick solution". I am looking for a secured & professional way if adding it, If anyone could help me It would be much appreciated Thankyou. 0 Quote Link to comment Share on other sites More sharing options...
Adam Posted June 24, 2007 Share Posted June 24, 2007 Hey, Change <?php and ?> to {php} and {/php} BTW: Your code doesn't make sense, whats the whole point of adding this to any .tpl file? From, Adam 0 Quote Link to comment Share on other sites More sharing options...
xeqution Posted June 24, 2007 Author Share Posted June 24, 2007 include("/includes/menu.inc.php"); I tried this, and it doesn't work. 0 Quote Link to comment Share on other sites More sharing options...
Iceman Posted June 24, 2007 Share Posted June 24, 2007 Actually it should be {php}...........{/php} Cheers, Paul 0 Quote Link to comment Share on other sites More sharing options...
Adam Posted June 24, 2007 Share Posted June 24, 2007 oops! Totally forgot about that! My bad. Ya it should be { instead of [. Thanks, Adam 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.