Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    May 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    something like .shtml in .html

    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?

  • #2
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    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 here or on Google, and see what you might find.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #3
    New to the CF scene
    Join Date
    May 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ya i'm about 90% sure it's Apache. I've heard of .htaccess but it's never worked.

  • #4
    New to the CF scene
    Join Date
    May 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #5
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    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.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #6
    New to the CF scene
    Join Date
    May 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #7
    New to the CF scene
    Join Date
    May 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    anyone??? I really need info lol.

  • #8
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •