Jump to content

[SOLVED] Warning: require()


xyn

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.