4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 includes and paths
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
billf
Junior WebHelper
Junior WebHelper


Joined: 25 Sep 2007
Posts: 1

PostPosted: Tue Sep 25, 2007 12:02 pm (16 years, 6 months ago) Reply with QuoteBack to Top

I am using JSP and want to use SSI as well. I have small html files for header, footer, etc that are included in the JSPs - these html files can refer to graphics in a common images directory.

As my site grows some pages are in the document root but I want to group others in sub-directories. This causes a problem because a valid path to an image from a page in the document root is not a valid path from a page in a sub-directory - e.g. the header.html cannot refer to "images/banner.jpg" for the index.jsp and "../images/banner.jpg" for the football/westham.jsp

This must be a common situation - what's the solution?

Many thanks,
Bill
OfflineView User's ProfileFind all posts by billfSend Personal Message
scottlpool2003
Junior WebHelper
Junior WebHelper


Joined: 14 Sep 2008
Posts: 3

PostPosted: Sun Feb 22, 2009 11:21 am (15 years, 1 month ago) Reply with QuoteBack to Top

Probably best using php to include the files, that's what I do and it works like a charm. You will need to rename your "header.html" to .php but it won't affect your site.

<? php include"folder/file.php"; ?>
OfflineView User's ProfileFind all posts by scottlpool2003Send Personal MessageVisit Poster's Website
ronzzkee
Junior WebHelper
Junior WebHelper


Joined: 15 May 2009
Posts: 1

PostPosted: Fri May 15, 2009 4:26 pm (14 years, 11 months ago) Reply with QuoteBack to Top

billf wrote:
I am using JSP and want to use SSI as well. I have small html files for header, footer, etc that are included in the JSPs - these html files can refer to graphics in a common images directory.

As my site grows some pages are in the document root but I want to group others in sub-directories. This causes a problem because a valid path to an image from a page in the document root is not a valid path from a page in a sub-directory - e.g. the header.html cannot refer to "images/banner.jpg" for the index.jsp and "../images/banner.jpg" for the football/westham.jsp

This must be a common situation - what's the solution?

Many thanks,
Bill




thanks for sharing some ideas, i learn something new now..


regards to u,



_________________
Vinyl Banners | My Sports
OfflineView User's ProfileFind all posts by ronzzkeeSend Personal Message
mazaa
Junior WebHelper
Junior WebHelper


Joined: 28 Sep 2010
Posts: 4

PostPosted: Tue Sep 28, 2010 7:43 am (13 years, 6 months ago) Reply with QuoteBack to Top

Remote file may be processed at the remote server (depending on the file extension and the fact if the remote server runs PHP or not) but it still has to produce a valid PHP script because it will be processed at the local server. If the file from the remote server should be processed there and outputted only, readfile() is much better function to use. Otherwise, special care should be taken to secure the remote script to produce a valid and desired code.
OfflineView User's ProfileFind all posts by mazaaSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.130749 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme