Archive for August, 2009

Back and forward button in JavaScript

Sure you can ask your visitors to use their brower’s BACK and FORWARD buttons to navigate your site. Wouldn’t it be nice to have your own BACK and FORWARD buttons on your pages: All you have to do is place the following HTML tags on your page: <FORM METHOD=”post”> <INPUT TYPE=”button” VALUE=”BACK” OnClick=”history.go( -1 );return [...]

Preventing Browser Cache

If you’re looking for a way to prevent browser cache, this HTML tip will assist you. Meta tags are used to give detailed instructions in regard to a web page to the Search Engines and browsers. When you get visitors coming to your web site, your visitors browser will cache or make a copy of [...]

5 htaccess Tricks Every Webmaster Should Know

Here are 5 sets of htaccess directives every webmaster should know: Redirect Visitors While You Update Your Site Update and test your site while visitors are redirected to the page of your choice: order deny,allow deny from all allow from 123.123.123.123 ErrorDocument 403 /page.html <Files page.html> allow from all </Files> order deny,allow deny from all [...]

How Domain Name Servers Work?

Domain name is an important part of website. When a Web Design Company has finished designing a website, the website files are transferred to the web hosting server. A website is said to be launched when it can be accessed on the internet using its domain name. In order for this to happen, the domain [...]

Replace text links with images using CSS

Anyone who knows anything about SEO knows that it’s most advantageous to use text links for the navigation of a website. Using text increases a search engine’s ability to crawl your site and identify the content properly, because it can read the text (spiders can’t read text within images). However, the aesthetic appeal of using [...]

Ordering Text Field Numerically(A MySQL Trap)

If whatever reason you have numbers stored in a text field (char, varchar etc)then watch out if you try and do an order by as it will do the sort alphanumerically this means it will sort 1,10,2,3,4,5,6,7,8,9 when you would expect 1,2,3,4,5,6,7,8,9,10. There is a work-around namely SELECT names FROM your_table ORDER BY names + [...]

Bulk "One Line" PHP scripts

Below scripts will be more useful for PHP developers to make their coding fast and efficiency. 1) Eliminate duplicate (or more) characters in a string (the underscore in the example below): $text = preg_replace(‘#(_)+#’,'_’,$text); 2) Randomly select of one element out of an array: $image = $image_array[array_rand($image_array)]; 3) Pass the htaccess/htpassword authenticated user to a [...]