Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

ssi, php or something else?


  • Please log in to reply

#1
TaNkZ101

TaNkZ101

    Member

  • Member
  • PipPipPip
  • 327 posts
what do u think is the best way of using something such as ssi? is it advisable to change the htaccess so that it thinks html is shtml so that there won't be any mistake when linking? i also tried using php require. also, when i include/require a file, such as header.html, should i have a doctype and charset and everything in header.html?
  • 0

Advertisements


#2
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
I would use php, you can do move with it later if you wan't to. I tend to keep the doctype in the web pages (I set the charset with the htaccess). What I put in the includes is stuff like the header and menu, that I change regulay and want the change to be site wide. And since you should have the <title> tag up the top, before the header and after the doctype it gets messy haveing the doctype in the php inclued.

Another great thing about php is you can get your pages sent out compressed for my home page that is from 4837 bites to 1884 bites (I also compress js and css as well).
  • 0

#3
TaNkZ101

TaNkZ101

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 327 posts
really? with what code can i sned out compressed so that it automatically decompresses? what do i put in the htaccess to set the charset? will the charset then appear in the source of the page(s)? asking because it's important to me that i pass xhtml 1.0 strict and css validation. yeah i also want to include the header and left side (menu).
  • 0

#4
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
Very simple actuly, on you main folder put a .htaccess with. I think the validator puts out an error about no charset found which is unfair.
php_flag zlib.output_compression On

AddType 'application/x-httpd-php; charset=ISO-8859-1' css js php xhtml html

Then you have to put the css files in a folder of there own along with another .htaccess with
php_value default_mimetype "text/css"
and in the folder with the js (and only js files)
php_value default_mimetype "text/javascript"

Now I better tell you how it all works, when a browser whats a page it sends a messages out like this "Hi am a Mozilla browser, I wan't index.html and I support compessed files and..." ect, and then the server sends out index.html compress and the browser decompress it. This works for IE and Netscape 4 and everything eles since. If the browser dose not say it suports compress files, it gets the non compressed stuff.

Change foo.php it what ever the real file you including is. What gose in the foo.php is exactly the same as what you would normaly put in html file for the menu. The server then stitches the files togeather and sends then out.
<?php include("foo.php"); ?>

Since you are useing xhtml I am going to ask to you read

Don't use XHTML unless you understand it: http://hixie.ch/advocacy/xhtml


Edited by Michael, 15 May 2006 - 08:01 PM.

  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP