Using Switch() function

Back in the old day when I first know how to program in php, I always used if-else statement. Sometimes, it gets so long that I couldn’t even keep track of how many if or else, and where the else supposed to be closed. I have no idea. It’s like a jungle of if else in my file. Since I started using switch() function, my codes are much cleaner when I need multiple conditions applied on one variable. I love it. If you only have…

Continue reading »

An easy way to build data Session for a form

You wonder how data of each field on a form can be refilled after you submit a page. This post will show you how to build an array of sessions that capture the input data of a user after they submit a form. If an anonymous arrive on your web form from the street, there’s no session until they enter some values and hit Submit button to process the form. First, you have to have a form to collect data on your website. When customer submit the…

Continue reading »