Posted on May - 24 - 2011

Vouchersolution.com – an alternate way to pay online!

I created it in the first quarter of 2011. You can buy vouchers from this website and use it in a lot of merchant sites which accepts this voucher codes. These are not coupon codes at all. They are generic voucher codes. So the system is actually a voucher-based online payment gateway! Here is how it works:

1. You want to buy something from a website which are vouchersolution’s partner (connected as a merchant in our site). Now you don’t want to give your credit card details in their website as many website lacks the security and authenticity.

2. Now you can buy a voucher of the price of your intended product/service at our site through vouchersolution’s authentic system.

3. Then go to that website where you wanted to buy the product. You can enter the voucher code in their system, and they will give you the product. As easy as it sounds! This voucher code is not fixed to a certain shop. You can use any code generated by us at any of vouchersolution’s partners!

Click on the image to go to the site. You can use it like customers, or even request to become a partner! The system is built in PHP, mySQL, apache, AJAX, jQuery. Totally custom work. Here is the reaction of Robi Canha, the owner of vouchersolution.com, on my work :

“Our project was not a simple one. It required a lot of expertise to get the solution to work the way we wanted it to work. Muktadir has had a very positive attitude throughout the entire project even when we needed to make some changes in order for the solution to work correctly, he was willing to see it through till the end. Very professional, hard working and definitely capable of delivery first class work. Will use him again.”


Posted on May - 24 - 2011

Class oriented programming

For well-managed small projects, class-oriented programming works very well, especially for scripting platforms like PHP, where you actually never save any object for later use.

Here goes my plan of class-oriented development:

1. Create classes for every Entity. So if you have entities like ‘category’, ‘person’, ‘product’, etc, you need to create classes with names Category, Person, Product and with filenames Category.class.php, Person.class.php, Product.class.php, respectively.

2. Every class of entities encapsulates all the functions that only communicates with its respective data-table. So model and a part of the controller go into that class.

3. Every entity class has some similar functions which we can reuse heavily! (only some replacement required). These functions are Get, Add, Remove, ChangeStatus, GetInfo, GetTotal . They have similar goals, so similar codes (fast and reusable!). So, there will be functions like Category::Add, Person::Add, Product::Add. They adds new entities of their respective type into the database!

4. Now the problem occurs with the relationships between the entities. Where you can put the functions which relates to many entities. It has some nice manageable solutions. Firstly, in a weak relation, keep the function in the weak entity class ( it’s more logical, as the every strong entity may not have a weak entity related with it). Secondly, for a relation between two strong entities, have the function in the subject entity ( what is a subject entity ? Recall English grammar 101).  Thirdly, if a entity has a total participation in a relation, have the relational functions in that entity’s class. Call me for other cases.

5. You can put the classes in the ‘includes’ folder, or the ‘classes’ folder. Check my FW.

Posted on April - 26 - 2011

IE visibility: hidden or display: none problem for submit button and an wise solution

I was creating a quick login form to place on the top left of a website I was building. The space was tiny for the form. And it was looking ugly with the submit button. So as I knew the enter button can submit a form, I left out the submit button. But without the submit button form couldn’t get submitted by pressing enter key!

Then I made a button like this:

<input type=’submit’ name=’submit’ style=’display:none’>

It didn’t work in IE7! I tried

<span style=’display:none’ >
<input type=’submit’ name=’submit’ >
</span>

then. It didn’t work either. I tried with CSS “visibility: hidden”, didn’t work either! I don’t know why microsoft did put this extra effort to cancel the default operation of the submit button if that’s not shown. I searched through internet, found a lot of keypress tracking thing with javascript solutions. But that’s not my way. So I made a cleaner solution:

<input type=’submit’ name=’submit’ style=’width:0px’>

LoL…there is always a backdoor ;) . Elegant, huh! Not yet…it has some positional problem! Here goes the fix:

<input type=’submit’ name=’submit’ style=’width:0px;height:0px; margin:0px; border:0px; background:green;position:absolute;top:-10px’>