Jump to content

External file help


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 post
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 post
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 post
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 post
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 post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...