Jump to content

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/59794-solved-warning-require/
Share on other sites

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 :/

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.