Search This Blog

Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Tuesday, September 15, 2009

HTML, Custom 404 Error

Use custom error page on your server (with Apache) is simply adding one line in your .htacess

e.g.
ErrorDocument 404 /notfound.html

Read more:
http://www.thesitewizard.com/archive/custom404.shtml

HTML, FieldSet

FieldSet and Legend combined can give you a nice box with title.

reference:
http://www.w3schools.com/TAGS/tag_fieldset.asp

Saturday, September 12, 2009

PHP, Compress Your Web Page to Speed Up

Compress your web page (on the server side) can save a lot of bandwidth.
Using gzip, the compression rate is usually over 50% !
You can test if your web page supports compression.
http://www.gidnetwork.com/tools/gzip-test.php
Just add the following line on the top of your PHP page.
(remember enclosed it with the php tag)


if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) ob_start("ob_gzhandler"); else ob_start();


Saving 5k (bytes) might not make your client feel the significant speedup, but it does cut down a lot of
your server traffic. Saving traffic is saving money.

If you can change your .htaccess, change it there for a server-wide improvement.
reference:
http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/

Monday, August 31, 2009

HTML, Auto Detect Character Encoding

To teach web browsers auto detect character encoding, meta tag can be used.
e.g.

meta http-equiv="Content-Type" content="text/html; charset=utf-8"

You can use more specific language encoding like Japanese, ASCII, etc...