View Full Version : this should be easy... but i think it's not!
gardanni
11-18-2004, 12:45 AM
I want to be able to include text from external files inside of other pages on my site. This is proving incredibly difficult! Can someone suggest a way to use CGI scripting to accomplish this? Specifics of my needs follow.
1. I want to access different external files for different pages.
2. The external files will always have the same filenames, and will always be in the same folder as the page that calls it.
3. Other constraints on this project dictate that my pages all have .HTM or .HTML extensions, and I cannot configure the server to process .HTM or .HTML files any differently.
Thanks to all!
Dan
dswimboy
11-18-2004, 03:08 AM
I don't think CGI is necessary. you should look at Server Side Includes (SSI)
here is a link http://hoohoo.ncsa.uiuc.edu/docs/tutorials/includes.html
specifically look at the SSI Setup section, and the SSI Format -> include command.
mlseim
11-18-2004, 03:19 AM
3. Other constraints on this project dictate that my pages all have .HTM or .HTML extensions, and I cannot configure the server to process .HTM or .HTML files any differently.
Dan
I think SSI (Server Side Includes) would all be .SHTML extensions.
So the pages that have the text you want to grab ... are those pages
(content) constantly changing? Not the page location, but the content
that you are grabbing?
Tell us about the page that is displaying text from the other pages.
Are you going to run a Perl script that takes the text and puts them
all into one static webpage, or will the Perl script actually display the
page dynamically (not a static web page)?
gardanni
11-18-2004, 03:35 AM
i can't believe it. i didnt even have to do the .htaccess mods - i just never knew that existed! i spent hours puzzling with this - whether i could get the PHP processor to process .htm files, whether i could set up empty php pages that called the HTM files or whether i could enact some elaborate frame structure to bring all the components together. Thank you very much!
dan
dswimboy
11-18-2004, 02:11 PM
SSI parsing can be enabled for almost any file type. check out http://www.wsabstract.com/howto/htaccess4.shtml
gardanni
11-18-2004, 02:22 PM
Tell us about the page that is displaying text from the other pages.
I am using a compiled script that generates web galleries. The script generates .htm files, and I can't hack into the script to tell it to generate any other extension. Since all the pages in the gallery are interlinked, changing the extensions would be cumbersome.
I couldn't hack into the script, but I was able to hack into the templates it uses, and decided that I could automate the inclusion of basic information such as photographer and contact information) by having that information residing in a consistently named file within each gallery. All that was missing was a means of accessing that file!
Thanks all for your help.
Dan
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.