![]() |
Inserting some PHP Code.. Which file?
I need to reference a variable, that the variable is set dynamically by some php code.. to exaggerate on the matter...
I need to set "$isie" based upon a php if statement, and then echo $isie within the smarty template. I realize to reference a php set variable in smarty, its {$isie}.. but which file should i put this PHP code in to be parsed before head.tpl? Thanks! |
Put it a file that's called on each php page like include/check_useraccount.php
You can put it in auth.php but realize that admin/customer/partner have different auth files. |
I need to do something similar with PHP. I need the following PHP to run on my home.php page. Where should I add it for it to be included on the home.php?
Code:
if($_GET['a_aid'] != '') |
Quote:
you could require this in home.php the same as categories.php is or just do the same thing using smarty code in the templates. use things like Code:
$smarty.get.a_aid ne "" |
Quote:
I tried requiring it in home.php like this: Code:
# $Id: home.php,v 1.1.2.4 2004/11/03 12:07:34 mclap Exp $ and then adding the php code I need into an affiliateid.php file but it doesn't display the code. I tried calling affiliate.php as an include but that only displays the code as is without parsing the variables. Not sure if I could use the smarty tag because it needs to call the t2.php file mentioned above to pass along the variables. |
Have you tried putting your php code into home.tpl surrounded with {php} and {/php}?
This works for me... Instinctual Colorado X-Cart Versions 3.5.x - 4.0.12 |
Nevermind.. I found the problem.
Helps when you aren't editing one file and uploading another... DOH! |
It's best to avoid using {php} tags in smarty whenever possible and keep the php in the .php file and the smarty code in the smarty templates.
|
All times are GMT -8. The time now is 09:39 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.