Dual form processing

April 14, 2009 No comments yet

Recently, a client of mine wanted a single web form, residing on the localhost to submit the form contents to a database in the localhost, and as well as to a web server simultaneously. Although this sounds like an unnecessary duplication of data, my client wanted some of the form data to be stored on the localhost for the intranet applications to use. Achieving this functionality would have been a piece of cake, if we were not handicapped by the unavailability of cross-domain AJAX. For those of us familiar with AJAX, we know that we cannot send an AJAX request to a remote server due to security reasons – atleast not in a reliable, hack-less way.

So, instead of looking for a pure AJAX solution, I decided to implement this functionality by using a combination of AJAX (for the localhost) and a traditional PHP POST request (for the web server). The trick here is to execute the AJAX call before the form is submitted – by catching the form submission event using JavaScript. Once the AJAX call is successful, we allow the default form submission to take place. In case there is an error with our AJAX call, we should…

No IE6 support on new W3C website?

March 27, 2009 No comments yet

W3.org is overhauling its website in order to make it more user-friendly and quiet people who used to wonder (including me) why the administrator body of web have such dull, flat, unorganized and old fashioned website?

The new website looks more attractive and organized. 10 minutes tour of new website can be found here. In contrast with the previous version, this new website uses rich content presentation, including JavaScript.

The website uses jQuery 1.3.2, a very known and popular JavaScript library, instead of pure JavaScript. This is very good news and a big leap towards streamlining the use of JavaScript frameworks, specially in case of jQuery. In addition of core jQuery framework, beta.w3.org also uses jQuery plugins (e.g.: http://malsup.com/jquery/cycle/), to enhance the user experience.

The biggest news of the day is w3.org beta website doesn’t render correctly in IE6. It’s supposed to be a strong argument for web developers in order to inspire and take initiative towards to stop exclusive coding to render their websites correctly in IE6.

See, Yes! Yes! – GO

December 9, 2008 2 comments

Modular CSS needs to be developed and all inherited properties needs to commented within CSS declaration so one don’t repeat same CSS again and selectors needs to named by some naming convention (e.g. prefixing every declaration by module).

Modules needs to be devised in such way so it remain plug and play if plugged in different application.

See, Yes! Yes! – STEADY

November 12, 2008 1 comment

Not every validated webpage is accessible or ideal but every invalid web page is bad. So always try to validate. First by validating from validators and then by common sense, because technically a page with thousands of nested DIVs are valid. button stimulated out of div is valid. But question is… Is it really?

Philosophy of Object Oriented Programming and Software Design

November 1, 2008 5 comments

Now, I am no expert in OOP or software design, but here’s a philosophy which might help you make the most of what you know about OOP and software design.

See, Yes! Yes! – READY

October 28, 2008 4 comments

In today’s web arena, CSS has proved its importance in rigid way. Web content is no more targeted to web browsers only, Web content is been served for a verity of media now days. To efficiently handle such situation CSS plays a very crucial role.

In order to extract maximum pulp from CSS fruit there are few things needs to keep in mind. Although rule of thumb is efficiency is directly proportional to experience but I’ll point out few options 3-part post series See, Yes! Yes! – READYSee, Yes! Yes! – STEADY and See, Yes! Yes! – GO. which can help novice CSS developers to take right diversions.

All of following points are optional and one can modify them according to needs and/or simply drop the idea.

Big Picture:

Planning is a must for mid or big projects…for small projects one can instantly start coding.

While coding for new design, web designer must analyze the design mock-up and slice the design by keeping in mind the facts which are resultant of observation and guideline of website/blog/web application.

e.g.

  • What portion of design mock can be translated by using CSS rules instead

How to hold a more effective code review

October 27, 2008 No comments yet

I found a very interesting article about Code Review that I’d like to share.

The article was written by Andrew Stellman and you can read it at Head First Labs in the address http://www.oreillynet.com/headfirst/blog/2008/09/how_to_hold_a_more_effective_c.html.

Enjoy!

Apache SSL – For Secure online transactions

October 24, 2008 No comments yet

Hey you are planning to start a e-commerce website, then you must know about SSL without which no one will trust your website as a safe place to use their cards…

What is SSL?

SSL (Secure Socket Layer) is a protocol used for secure data transfer. This is done by using private keys and certificates. A private key is used to encrypt the data which you are sending and the server can only decrypt this data with the private key available with it, A certificate is used to authentic yourself before proceeding.

So we need two things to make our website secure for online transactions. In this article i will explain how to generate a private key with open-ssl and apache, how to generate a certificate request from CA (Certificate Authority). How to configure your server to respond for ssl requests.

We use Apache 2, Debian Linux, Openssl for this article.

First step is to install Apache:

Go to console mode

aptitude install apache2

next install openssl to generate keys and certificates or certificate requests

aptitude install openssl

next generate certificate request and key using openssl

openssl req -new -nodes

Yes, I'm an OOP developer! But Design Patterns?!?

October 22, 2008 2 comments

“Well, I went pretty fine on my Object-Oriented experience. I’ve learned something about polymorphism, inheritance, encapsulation and now I really know how to extend a class! I’m ready for developing cool object-oriented applications.”

But what about the design? No, no… I don’t mean that design where you place the squares and circles in their places, draw lines, beautiful backgrounds and all those kind of stuff. I’m talking about Software Design. Design in terms of objects. Which objects to use, how and when to use, how the hierarchy would look like, which object should extend which object, when to encapsulate, when not.

It’s very common for developers to misunderstand Object-Oriented Programming with its basis concept (abstraction, inheritance, encapsulation, polymorphism, interfaces). Only because you know how to extend a class doesn’t mean that you really understand Object-Oriented Programming. It’s quite more than this.

First, let’s start with Design Patterns. Design Patterns are proven reusable solutions to solve a software design problem that other developers already faced before you. It’s not a kind of pre-cooked cake, where you just need to put in your heater for some time to get it done, but a description or template for how to solve a problem…