xyn Posted July 13, 2007 Share Posted July 13, 2007 Hey. I'm just trying to learn Smarty Engine, and I'm struggling on the easiest part thing is every tutorial tell me to require the Smarty.class.php and i get the following errors! Warning: require(Smarty.class.php) [function.require]: failed to open stream: No such file or directory in /index.php on line 2 Fatal error: require() [function.require]: Failed opening required 'Smarty.class.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /index.php on line 2 My PHP page <?php require('Smarty.class.php'); $smarty = new Smarty; $smarty->assign('name', 'Ash Meadows'); $smarty->display('index.tpl'); ?> My Smarty Page <html> <body> <div align="center"> <center> <table border="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#608A20" width="250" height="250"> <tr> <td width="100%" bgcolor="#95D13A" align="center">Welcome {$name}</td> </tr> </table> </center> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/59794-solved-warning-require/ Share on other sites More sharing options...
Yesideez Posted July 13, 2007 Share Posted July 13, 2007 And what exactly did you call th smarty script? Is it in the same location as the file that is includeing it? Quote Link to comment https://forums.phpfreaks.com/topic/59794-solved-warning-require/#findComment-297291 Share on other sites More sharing options...
MadTechie Posted July 13, 2007 Share Posted July 13, 2007 1. check the Smarty.class.php is uploaded to the site 2. check the name is Smarty.class.php not smarty.class.php 3. check their in the location Quote Link to comment https://forums.phpfreaks.com/topic/59794-solved-warning-require/#findComment-297295 Share on other sites More sharing options...
xyn Posted July 13, 2007 Author Share Posted July 13, 2007 ok. well 1. these tutorials DONT give the coding for Smarty.class.php so i guess their trying to get you to include the Smarty.class.php from the Smarty folder. same as PHP. except to use the php language you dont need to include "PHP.class.php" :/ 2. As there is no coding for thise file. how can i create it? 3. a blank file is useless. So i'm just asking for someone who Knows/uses Smarty to help me understand what these turoials actually mean with this "Require" business ...and Smarty.class.php is right, the S is uppercase :/ Quote Link to comment https://forums.phpfreaks.com/topic/59794-solved-warning-require/#findComment-297298 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.