alin19 Posted October 9, 2008 Share Posted October 9, 2008 i have developed a site on my local computer: windows with xampp all working good, now i have bought a domain an a host and i'm trying to upload my files. i've done that but when i try to enter the page from my browser only the php code is writed, the html code that my smarty should get isn't shown. can you help me? $smarty->template_dir = "../templates/"; $smarty->display('nelogat.html'); Link to comment https://forums.phpfreaks.com/topic/127750-smarty-template_dir-problem/ Share on other sites More sharing options...
DarkWater Posted October 9, 2008 Share Posted October 9, 2008 What do you mean by "only the PHP code is writed"? Link to comment https://forums.phpfreaks.com/topic/127750-smarty-template_dir-problem/#findComment-661141 Share on other sites More sharing options...
Chicken Little Posted October 9, 2008 Share Posted October 9, 2008 Have you uploaded any required smarty files (such as smarty.class.php or smarty_compiler.class.php)? Link to comment https://forums.phpfreaks.com/topic/127750-smarty-template_dir-problem/#findComment-661143 Share on other sites More sharing options...
alin19 Posted October 9, 2008 Author Share Posted October 9, 2008 i have uploaded all my folder! including all smarty files. i mean that i have 2 files: test.php and test.html test.php contains: echo "test"; $smarty->template_dir = "../templates/"; $smarty->display('nelogat.html'); test.html contains this is html file and only apears test; now i have changed permision of folder templates_c to 777 and still doesn't work, i has anything to do with folder cvs? Link to comment https://forums.phpfreaks.com/topic/127750-smarty-template_dir-problem/#findComment-661148 Share on other sites More sharing options...
DarkWater Posted October 9, 2008 Share Posted October 9, 2008 Where do you actually instantiate $smarty into a Smarty object...? Link to comment https://forums.phpfreaks.com/topic/127750-smarty-template_dir-problem/#findComment-661157 Share on other sites More sharing options...
alin19 Posted October 9, 2008 Author Share Posted October 9, 2008 <?php echo "test"; include("db.php"); include("smarty/Smarty.class.php"); if (!isset($_SESSION)) { session_start(); } if (!isset($_SESSION['login'])) $_SESSION['login']=false; $supraveghetor = array(); $smarty = new Smarty(); $conexiune = new db(); $conexiune->open(); include ("categorii_selectare.php"); $supraveghetor['login']=$_SESSION['login']; $conexiune->close(); $smarty->assign("supraveghetor", $supraveghetor); $smarty->template_dir = "..templates/"; $smarty->display('nelogat.html'); ?> Link to comment https://forums.phpfreaks.com/topic/127750-smarty-template_dir-problem/#findComment-661159 Share on other sites More sharing options...
DarkWater Posted October 9, 2008 Share Posted October 9, 2008 $smarty->template_dir should be "../templates", not "..templates/". I don't think Smarty wants / on the end of the directories (I'm 99% sure of that at least, so try it anyway). Also, please use tags when posting code. Link to comment https://forums.phpfreaks.com/topic/127750-smarty-template_dir-problem/#findComment-661161 Share on other sites More sharing options...
alin19 Posted October 9, 2008 Author Share Posted October 9, 2008 it works also with : $smarty->template_dir = "../templates/"; but i've tryed to modie this folder and forgot to try with /templates/ after modifing permision to write in template_c 10x, now is working Link to comment https://forums.phpfreaks.com/topic/127750-smarty-template_dir-problem/#findComment-661170 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.