Archive for August, 2007

19th Aug 2007

Removing file extension via .htaccess

Problem:
You have the following URLs for your website:
www.example.com/about-us.html
www.example.com/services.html
www.example.com/contact-us.html

However, you would like to hide file extensions from the end users, and allow them to access to the files using the following URLs:
www.example.com/about-us
www.example.com/services
www.example.com/contact-us

Solution:
The solution can be achieved by using Apache’s mod_rewrite. Create an .htaccess file in your website root directory with the following content.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME}!-d
RewriteCond %{REQUEST_FILENAME}!-f
RewriteRule ^([^.]+)\.html$ $1 [L]
# Replace html with your file extension, eg: php, htm, asp

Benefits:
- Search engine friendly
- Easier to read and remember
- Extension/environment independent; when you change the technology used for your website (for eg: from using asp to php), you can be assured that all the links and bookmarks will still work.

Technorati Tags: , , , ,

Posted in Snippets | 1 Comment »

16th Aug 2007

The #1 Programmer Excuse for Legitimately Slacking Off

The #1 Programmer Excuse for Legitimately Slacking Off

Source: xkcd - A webcomic of romance, sarcasm, math, and language

Technorati Tags: , , ,

Posted in Random | No Comments »

14th Aug 2007

Becoming a Web (PHP) Developer

Last week, I was asked to give my two cents worth on the process of learning PHP and therefore I came up with the following.

  1. Introduction to PHP — Learn what you can and can’t do with PHP, how similar/different it is to other programming languages, what is object-oriented PHP, etc
  2. Installation — You will need to have a development environment to practise PHP, be it your local machine or a dev server
  3. Basic syntax, data types, and operators
  4. Control structures
  5. Introduction to MySQL
  6. Connecting to MySQL from PHP
  7. Querying MySQL with PHP
  8. Writing custom functions and libraries
  9. Writing a web application or a dynamic website in PHP
  10. Security in PHP
  11. Best practices

And while we are on the topic of becoming a Web (PHP) Developer, Robert Love at Signified has written an article on a list of things you should know about when trying to become a web developer and make lots of money. In his own words:

Over the recent days I’ve been asked to speak with a few new starters where I work. As budding (and not-so-budding) web developers, they’re eager to latch onto the next big thing and blog about it in order to appear cool (oops!). So, in order to stop repeating myself and free up more time for shameless self-promotion, read on if you want to become a web developer and make lots of money.

Remember to engage your sense of humor before reading the article.

And last but not least, my advice to you is to actually start coding and writing applications in PHP because I have always found that the best way to learn something is by doing it.

Technorati Tags: , , , , ,

Posted in PHP | No Comments »

14th Aug 2007

The Evolution of Link Farm

First, we had Directory Listing
Directory Listing

Followed by Free 4 All Links
Free 4 All Links

Then there was a hit with The Million Dollar Homepage
The Million Dollar Homepage

And then came Color Cubes
Color Cubes

And today, in “web 2.0″ age, we have Tag A Cloud
Tag A Cloud

Technorati Tags: , , , ,

Posted in WWW | No Comments »

13th Aug 2007

Wanna learn PHP?

Recently, a few people have been approaching me with their interest in learning PHP and today, I came across this article PHP 101: PHP For the Absolute Beginner via Digg. Talk about timing!

This area is intended for everyone new to PHP. It opens with a series of informal, entertaining tutorials written by Vikram Vaswani, founder and CEO of Melonfire. These tutorials build on a previously-published 5-part series which has now been updated and extended to embrace PHP 5, making parts of it suitable for those of you who already have worked with PHP 4 in the past.

If you came here to learn about elementary PHP 4 or basic PHP 5, this is for you. Enjoy!

The tutorials are divided into 15 main sections as below:

  1. PHP 101 (part 1): Down the Rabbit Hole
  2. PHP 101 (part 2): Calling All Operators
  3. PHP 101 (part 3): Looping the Loop
  4. PHP 101 (part 4): The Food Factor
  5. PHP 101 (part 5): Rank and File
  6. PHP 101 (part 6): Functionally Yours
  7. PHP 101 (part 7): The Bear Necessities
  8. PHP 101 (part 8): Databases and Other Animal
  9. PHP 101 (part 9): SQLite My Fire!
  10. PHP 101 (part 10): A Session In The Cookie Jar
  11. PHP 101 (part 11): Sinfully Simple
  12. PHP 101 (part 12): Bugging Out
  13. PHP 101 (part 13): The Trashman Cometh
  14. PHP 101 (part 14): Going to the Polls
  15. PHP 101 (part 15): No News is Good News

Enjoy learning PHP!

Technorati Tags: , , , ,

Posted in Tutorials, PHP | 2 Comments »

Free Anonymous Proxy