HalifaxPiper Posted January 31, 2006 Share Posted January 31, 2006 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 More sharing options...
Skemcin Posted January 31, 2006 Share Posted January 31, 2006 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 More sharing options...
aspnetguy Posted January 31, 2006 Share Posted January 31, 2006 You are better off writeing a simple ASP or PHP script to accomodate this...make sure your server supports PHP or ASP or what ever language you want to use. Link to comment Share on other sites More sharing options...
HalifaxPiper Posted February 2, 2006 Author Share Posted February 2, 2006 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 More sharing options...
Eric Posted February 2, 2006 Share Posted February 2, 2006 Actaully, you CAN use SSI with HTML, but you have to give you page the .shtml extension<!--#include file="filename.extension"--> Link to comment Share on other sites More sharing options...
aspnetguy Posted February 2, 2006 Share Posted February 2, 2006 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???? Link to comment Share on other sites More sharing options...
Eric Posted February 2, 2006 Share Posted February 2, 2006 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????<{POST_SNAPBACK}> 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 More sharing options...
aspnetguy Posted February 2, 2006 Share Posted February 2, 2006 ok...I am out of the loop on the specific details on issues like this...I just now what you have to do but not always why. Link to comment Share on other sites More sharing options...
Eric Posted February 2, 2006 Share Posted February 2, 2006 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 More sharing options...
aspnetguy Posted February 2, 2006 Share Posted February 2, 2006 thx Link to comment Share on other sites More sharing options...
Eric Posted February 2, 2006 Share Posted February 2, 2006 Glad I could be of some help :)By the way, you can read more about it here http://www.webhelpinghand.com/htaccess_mime.htm Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now