It's not a secret anymore!
The moose likes PHP and the fly likes PHP basics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » PHP
Bookmark "PHP basics" Watch "PHP basics" New topic

PHP basics

bala kan
Ranch Hand

Joined: Aug 20, 2012
Posts: 44

Hi Friends,

I would like to use the tpl file, php file and html file just to display the welcome message..

tpl file is

php file

Html file

but it gives an error:
Warning: Smarty error: unable to read resource: "welcome.html" in C:\wamp\www\tpl\lib\Smarty.class.php on line 1094

please rectify me...

Thanks in advance..

Matthew Brown

Joined: Apr 06, 2010
Posts: 4543

Well, the obvious answer is that it can't find the file. Either it's looking in the wrong place, or the web server doesn't have permissions to read it.

By the way, this isn't about your specific question, but the way you're using your files looks very strange. Why do you have all the HTML document stuff (<head> and <body> tags etc) in all three files? It should only be in the template. The PHP file shouldn't have any static content - it's just passing things on to the template engine. And the welcome.html file is being included in the middle of a page. If it was working, you'd be getting output something like this:

See what I mean?
I agree. Here's the link:
subject: PHP basics
It's not a secret anymore!