HTTP Tricks

Redirect everyone to different site except 1 IP
ErrorDocument 403 http://www.htaccesselite.com
Order deny,allow
Deny from all
Allow from 1.1.1.1

Set the Timezone of the server
SetEnv TZ America/Indianapolis


Set the Server Administrator Email

ServerSignature EMail
SetEnv SERVER_ADMIN spamkill@spamkill.com

Read More......

Prevent Caching a Page

header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Pragma: no-cache');
?>

Read More......

Drag and Drop table columns for an HTML table

Just add class=sortable to a table tag and its column headers automatically support click to sort. Pretty slick. Once you have the JavaScript in place, you can simply add a class="draggable", and you can even work with both via class="draggable sortable".

Demo
sorttable.js
dragable.js

Read More......

Crypto on PHP

Crypto usage in PHP is simple, but that doesn't mean its free. First of all denpending on the data that you're encrypting, you might have reasons to store a 32-bit valuein the database instead of the 160 bit value to save space. Second the more secure the crypto is, the longer is the computatiom time to deliver the hash value.

The major difference between md5(), crc32() and sha1() is the length of the hash generated.

crc32() generates 32 bit.
sha1() returns 128 bit.
md5() gernerates 160 bit.

Read More......