trouble using {php}include(filename);{/php}
gkh01
Joined: 2007-02-22
Posts: 3 |
Posted: Thu, 2007-02-22 04:31 |
Elsewhere in the forum I saw where someone was told how to include a php file using this syntax: {php}include(filname);{/php} On my site I have a navigation bar that is included on each *.shtml page using a SSI statement: Of course the point is to update only navbar2.htmlf when a change is needed. In order to make G2 appear like every other page on my site, I tried to add it to public_html/gallery/themes/classic/templates/local/theme.tpl using this statement: But I get this error message: Site is http://66.249.137.29 (domain name hrsms.org being transferred) Thanks in advance !!! |
|
Posts: 32509
the path is probably wrong.
where's this navbar2.htmlf file? maybe at '/home/hrsmsor/public_html/navbar2.htmlf' ?
--------------
Doumentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage
Posts: 3
Yes, the navbar2.htmlf is in the public_html folder.
I thought starting with a slash would make the path relative to public_html.
I know I've used it that way with success before, but perhaps not for SSI or PHP includes. I know for sure it is working for linking-in my css file. Is this not legal for a PHP include? I'm at work and this code is at home. I'll look this evening to see if I've used it that way in the past. Even if I have, maybe it doesn't work with the smarty code (which is 100% new to me starting with last evening).
I've never seen/used a path starting with /home/... I'll try that.
Thanks.
Posts: 3
Changing from
{php}include("/navbar2.htmlf");{/php}
to
{php}include("/home/hrsmsor/public_html/navbar2.htmlf");{/php}
did the trick
This works
<img src="/images/pic.jpg">
For an image stored in public_html/images
Obviously the php include command does not work the same way. Thanks for the tip.