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 11 of 11
  1. #1
    New to the CF scene
    Join Date
    Jan 2003
    Location
    QonoS'
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    read .txt files as html

    Hailings Gentlemen!

    I am new to this forum, so I'd like to bid my greetings to all of you first of all.

    Now, here's my problem:

    I am running a Star Trek related site on a free host. My site is designed to look and behave like a LCARS (computer) display, with touch areas, iframes and the like.

    If I'd upload my files as .html pages, the host would stamp me a great ad banner on each of these pages, thus spoiling the whole look. I found a way to work around this by naming my HTML files as .txt files, which works perfectly well in IE5 and above because I get the file displayed like HTML pages. But this only works with IE.

    Question:

    Does anyone know of a way to convince NS, Opera, and Mozilla to treat pages with extensions other than .html to be displayed as HTML encoded web pages?

    Maybe I didn't make myself clear enough (English is not my natal language):
    IE seems to display a file dependent on it's CONTENT, and not by it's EXTENSION. Other browsers don't, so if they're told to load a file named "***.txt", they display it as plain text, regardless of it's content.

    It would be of great help if anyone could provide me with a trick to work around this - non-Java preferred.

    Thank you.
    Worf
    Last edited by Worf; 01-28-2003 at 11:36 PM.

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72 W. 48' 57" , 41 N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    even if i knew of a way to make this work, i'm afraid that i wouldn't tell you. that banner ad is part of the terms you agreed to when you got the space with your host. by bypassing that banner, you're breaking the contract that you made with them, and you're stealing that webspace from them. sorry.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #3
    New Coder
    Join Date
    Oct 2002
    Location
    California
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry Worf, the ads are part of the "deal", you'll be better off spending $5-$10 per month on a real host with no ads.

  • #4
    Regular Coder
    Join Date
    Jan 2003
    Posts
    680
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sure. Configure the server to serve .blah as html. Could also be done with a .htaccess file. But perhaps your host doesn't allow that?
    (o<
    //\ &nbsp; &nbsp; &nbsp; =^..^=
    &nbsp; &nbsp; $!

  • #5
    New to the CF scene
    Join Date
    Jan 2003
    Location
    QonoS'
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Well thank you

    I'll try the .htaccess thing.

    But, to make it clear to the "moralists":

    I said I'm running a page with SEVERAL iframes in it. The beloved ad banner is displayed on the index page anyway; I DON'T see any need to display it in every single iframe again! (besides that, most of the iframes are so small that you'd have to scroll the iframe up/down/left/right to view all portions of the banner in it let alone the actual content... doesn't make much sense, don't you think?)

    Of course, I could change the basic settings and get a popup window instead of a banner displayed. Let's see... that would make about 5 to 10 popups per operation, depending on the quantity of data displayed. Nice, eh?

    Now would you like to visit such a site???

    Ads may be ok, but when they become annoying...

    Heavy banners and happy popups to all!
    Worf

  • #6
    Regular Coder
    Join Date
    Aug 2002
    Location
    Spain
    Posts
    420
    Thanks
    0
    Thanked 0 Times in 0 Posts
    don't use iframes o find a better hosting. I understand that it's stupid to have so much banners in the page, but the rules are the rules.

    Insurrection not allowed
    Don't resist to assimilation. Billions of Borgs can't be wrong!

  • #7
    New to the CF scene
    Join Date
    Jan 2003
    Location
    QonoS'
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hailings, Borg!

    You sure sound like Borg:
    Efficient, cold-blooded, and totally without imagination (smile!)
    Well you said that insurrection is futile: how about a resurrection??

    Nevertheless, I'll keep trying to solve the problem. Just wanted to say hello to you, because in MY universe, the Borg have become my FRIENDS.
    Sic transit gloria mundi...

    Quapla'!
    Worf

  • #8
    Regular Coder
    Join Date
    Nov 2002
    Location
    Southern California
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts
    this may be the answer to your problems:


    http://www.codingforums.com/showthre...threadid=13993
    Everyone has the right to be stupid, some just abuse the privilege.

  • #9
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Try using
    <meta name="Content-type" conent="text/html">

    at the top of your pages
    or search google for "Content-type="text/html" and see what you get.

  • #10
    New Coder
    Join Date
    Dec 2002
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts
    does your host support php?
    if it does then u can call these .txt pages using php include and using the links so it comes up on the main page
    all you have to do is add stuff like
    <b></b>
    <br>
    <p>
    etc.... to add affects to your page

    1: ensure that your host supports PHP, if your host dose move on to step 2.

    step 2: make your layout using normal html. step
    3: delete every thing in the area that you want your content to show up. and replace it with this code
    <?php if($page == "") { include "news.html"; } else { include "$page.txt"; } ?>

    $page is the wild card page so if you want to include news your link would be ?page=news now if you change $page to something like $id the link would be ?id=news. you can change $page to what ever you would like but you must have a '$' at the beginning of the word or it will give you a parse error. step
    4: all your links have to
    <a href="?page=YOUR FILE NAME HERE">LINK TEXT HERE</a>
    be or it wont work. with out the extension if you want to use the extentsion then remove the .txt from the second include

    if you need a free host that supports php then try these links

    No ads (well that i know of)
    http://www.portland.co.uk/

    Ads (i think most of them do)

    http://www.fateback.com/

    http://www.spaceports.com/ Tested.

    http://www.t35.com

    http://www.coolfreepages.com/

    http://www.dk3.com/hosting/

    http://www.fairmount.nu/

    http://www.neopages.net/info.shtml

    http://www.i-networx.de/ German language

    http://www.hostultra.com/ Beware of porn-pop-ups. I tested it, but the pop-ups are bad.


    well i hope this helps c-ya




    -[Xphp]-
    print="TO Ask Will Unmask The Obvious-Jose 2002";

  • #11
    New Coder
    Join Date
    Dec 2002
    Posts
    41
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i forgot to metion then u need to save the file that will be including these files
    filename.php
    or it won't work
    print="TO Ask Will Unmask The Obvious-Jose 2002";


  •  

    Posting Permissions

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