Once upon a time, it was painful developing websites using different technologies, making it even harder to configure these to work in sync. With PHP coming into the limelight, its become a lot easier to develop websites from scratch…

I started learning this language on being given a project at work to design/implement a tool which was to be used for scheduling some of our jobs, which was done manually. Well, after reading a bit about PHP, it was clear using Apache, MySQL and PHP should be the easiest to cook up a website. Some of the advantages you might have using this bundle :

  1. Pre-configured packages such WAMP ( windows ), LAMP and XAMPP make it incredibly easy to install PHP, Apache HTTP server and MySQL.
  2. Well, there does exist a bundle for Solaris too, its called SAMP. The latest version can be installed using Glassfish 1.5, provided by Sun Microsystems.
  3. Once installed, you are ready to go !! No need of manually configuring any parameters, ain’t that awesome !! (well, you might want to change httpd.conf to set the path to webroot, location inside which your source files would be housed and picked up by the webserver or if you want to change the port on which your localhost is to be accessed via)
You will find several tutorials on installation of XAMP, LAMP or XAMPP and I wont go into the details of it. Simply google it, and you will have a bunch of documents you could refer to…

I started off with developing login, registration ( authentication ) for my website. It was fairly straightforward, created a USERS table having some cliche` looking fields such as username, password, firstname, lastname, email, created_date, modified_date….well, you get the idea…basically whatever you want to save about a user.


CREATE TABLE users (
id integer auto_increment,
username char(50),
password char(100),
firstname char(30),
lastname char(30),
email char(30),
PRIMARY KEY (id)
);


Getting such an authentication up for my site did not take long, but I then realized there must exist certain frameworks which make such tasks simpler for us. Well, after googling for it a bit, CakePHP is one such framework. And how do you implement authentication using it, with probably 15-20 lines of code….Im not kidding, I did mean 15-20 lines.

Please wait on, I will get into more details on installing CakePHP and having it work with your existing AMP. I’m using WAMP, the steps I follow would most likely be applicable to the same installation.

A few useful links I will leave you with :

  1. Download Eclipse – I use this as an editor for php development
  2. Install Wamphttp://www.wampserver.com/en/download.php
  3. Install UML toolhttp://amateras.sourceforge.jp/cgi-bin/fswiki_en/wiki.cgi?page=AmaterasUML – I like drawing up some UML diagrams before actually getting to implementation. You can overlook this step.
Advertisements