Jump to content

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

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.