Jump to content

Template system


NLT

Recommended Posts

Try defining the path from the root of the site by including a forward slash at the beginning. Otherwise, without it, you are defining it relative from the current working directory.

$dir = "/template/skin";

Warning: file_get_contents(/template/skin/404.tpl) [function.file-get-contents]: failed to open stream: No such file or directory

 

Although if I type /template/skin/404.tpl with the document I'm on (no index.php etc) then it downloads a tpl file.

Link to comment
https://forums.phpfreaks.com/topic/262831-template-system/#findComment-1347088
Share on other sites

As I said, that path is a relative path. That means it is relative from the current working directory. The workign directory is different based upon which file is being run. You need the path to be hard coded from the root of the file path, e.g. c:\some_directory\another_directory\. But, if you are on a shared host, I have no idea what it would look like.

Link to comment
https://forums.phpfreaks.com/topic/262831-template-system/#findComment-1348101
Share on other sites

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.