Monday, October 25, 2010

Home Grown : 2. LAMP - modelling a website

Here we'll take a look at how a website looks from a programmers perspectives. We'll take a look at what constitutes it and what should we use for which purpose.

1. HTML: A website has the HTML pages which constitute the look and feel or in other words The Front-end. Plain text files with embedded tags that dictate the Presentation of Information.

2. CSS: We use Cascaded Style Sheets to enhance the looks. We can design colour themes and appearance of text and various page elements. CSS styling thus is a very important part of our exercises. Every HTML tag has some standard attributes which we can manipulate through CSS for streamlined look. We can also define various styling for different portions of our website.

3. JavaScript: JavaScript is the client-side script. We use JavaScript to perform certain operations at client-side that can ease processing of request on Server. E.g. Form Validation. With introduction of technologies like AJAX JavaScript's use has increased. Also with various libraries like jQuery JavaScript is used to provide various effects for page elements. These days JavaScript has become as indispensable as CSS for an aesthetically pleasing website.

4. Server side Programming: This is something that resides at server and takes care of your requests and responds to you with appropriate response. At first people used to have programs accepting user request and produce appropriate response. Those were (somewhere still are) cgi(Common Gateway Interface) programs. Later with the advent of server-side programming techniques we ended up with frameworks/Technologies that ease processing of Requests. Here we're using PHP to code our website. PHP is easy to learn, loosely typed, and very powerful.

What we'll have and where it will be?

Of course everything will be on the server. Since we're building this in PHP we won't have any actual HTML pages. All pages will be PHP only. It's just an HTML Page sans any PHP code in it. This works since the browser is not concerned with the URL - whether the page served is a HTML or PHP - but rather if the response is in correct format.

On server for the sake of ease of access we group similar files in folders. So we have a 'CSS' folder in which we put all CSS files. Another folder 'scripts' stores all our Java Scripts. Similarly we can put all PHP pages into another folder. This is necessary for very big websites where we have hundreds of pages.

Tools: What is required?
This is something that you'll have to decide for yourself. There are many suites/IDE's that allow you to build beautiful websites. For this I'm using Netbeans IDE. It has very good support for HTML, CSS and PHP. The JavaScript support is okay. So you cna start from there.
There are many other IDE's for PHP. You can try them too.
I use firebug Firefox Extension for JavaScript debu‌gging. It's excellent for debugging and also for checking the DOM tree and other things.

Download the Project from

No comments:

Post a Comment