Jump to content

External file help


HalifaxPiper

Recommended Posts

I have a page made up of cells containing text such as 'Name', 'Age', 'About'.At the moment I use three .htm files and the SSI <!--#include virtual="name.htm" --> for each cell of info. How can I use one file and direct the right info to the right table cell?The idea is to allow my friends to upload a simple text file to change information on their pages when they wish.Thanks for any directionMark :)

Link to comment
Share on other sites

if you're just using HTML, there is nothing you can do. If you are using a scripting language (at least with cold fusion) you can code an SSI to include a variable <cfmodule template="includeme.cfm" n="5">. The includeme.cfm file would have conditions that say if n=5 then show this stuff, if n=4 show this stuff, etc. So one SSI could be used for multiple functions.But HTML alone - to my knowledge - will not allow it. You might be able to pull it off with javascript - but that's just me thinking out lowd. :)

Link to comment
Share on other sites

Thanks people. I went with server side includes being .html files containing well... html :) I am making a PHP copy of the page with multiple forms which save the input into the named .html files. It may sound odd but is seamless when running and fills my need for user editable content with restrictions. Thanks Mark

Link to comment
Share on other sites

ah yes that is true...why do you have to change the extention to shtml if it is still html? is it a security thing????

By default .shtml is the MIME type that handles server-side includes for HTML.If you wanted, you could set up .html or .htm to allow server-side includes in a .htaccess file. So it doesn't *have* to only be .shtml but by default it is. :)
Link to comment
Share on other sites

If you want to use server-side includes with .html or .htm put this in a .htaccess file

AddType text/x-server-parsed-html .html .htmAddHandler server-parsed .html .htm

And the reason is to save on server load, if there are no server side elements to include (i.e. a .html or .htm file) then there's nothing for the parser to check.If by default they allowed server-side includes, then even if they didn't have any server-side elements the parser would still check them.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...