...

View Full Version : something like .shtml in .html



echo_tyme
05-03-2004, 11:47 PM
Hi... I searched DD but found nothing to help me...

I have a site with a bunch of tables, and want one of them (in every page) to have text that will vary according to what i want it to say...

So maybe i want it to say like.... "Welcome here" and next week i'll want "Welcome to this place" (stupid but you get it). Well I do'nt want to update over a hundred pages everytime I want it to be new... and I do'nt want to convert to .shtml (isn't .html better anyhow?). Anyway I want it so that I can just have a txt or a page somewhere on my site that i can link ever page to, so when I change the text in that one page, txt, w/e... every page on my site will change.

Just like the menu I have, I can link all my pages to one menu, so when I add a new section, I change one menu, not 100 pages... Is there a way to just have text show up according to one page, or do I have to change to .shtml...

And isn't it confusing in .shtml b/c if someone tries to access a page and doesn't have the .shtml (b/c 90% of ppl don't know of .shtml and only .html and .php).... then it won't load...

IS there a java script or someway of just adding a small code to accomplish this without converting?

liorean
05-03-2004, 11:52 PM
The best tool for the job would probably be using mod_rewrite in .htaccess, if you're on an Apache server. Make a search for it (http://www.codingforums.com/search.php?searchid=16378) here or on Google, and see what you might find.

echo_tyme
05-04-2004, 12:12 AM
ya i'm about 90% sure it's Apache. I've heard of .htaccess but it's never worked.

echo_tyme
05-04-2004, 12:48 AM
I've been looking but tha'ts not what I need.

I use .html extentions (haven't learned PhP yet). I need something in HTML that can look at one file name and display the contents. So I update one page and the webpages I have will display what it says.

Just like .shtml u can have it look in a .txt and show what's inside, is there anything in HTML that can do that.

liorean
05-04-2004, 12:52 AM
The file extension is of no consequence. You need to use a serverside language for it, and use .htaccess to set the handling up correctly.

Moving this thread to serverside.

echo_tyme
05-04-2004, 01:51 AM
According to a website (ur gonna laugh at me)

http://lissaexplains.com

u have to make the extention .shtml so u can add

<!--#include file="yourfilename.txt" -->

that will make what I want, but it clearly states you have to have .shtml!

Will it work just plain as .html b/c this entire site (her's) is built on .shtml pages.

echo_tyme
05-05-2004, 02:17 AM
anyone??? I really need info lol.

jbot
05-05-2004, 02:39 PM
if you're gonna display the content of one page in many pages, then you want to use Server Side Includes (SSIs), like the example you game.

the exact syntax can either be '<!-- #include virtual="filename.inc" -->' or '<!-- #include file="filename.inc" -->', but i forget the differences between them.

your parent file's name doesn't have to end .shtml. it can end in anything you want. it could end in .echo_tyme for all the browser cares. but your server has to be configured to support this. generally, for Apache it's .shtml and for IIS it is .stm.

hope, that helps :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum