Archive for the ‘Sample Code’ Category

Looping Statements Doesn’t loop?

Sunday, August 10th, 2008

Image Source: www.pragprog.com Did you know that looping statements doesn’t loop the whole if-else statement if you put an if-else statement in the looping statement? That’s right. Looping statements only goes through the if-else statements once. Once the looping statement activates the statements inside the if-else statement, the looping statement will ...

Arrays

Tuesday, July 1st, 2008

Arrays are what tables are to C-based programming languages and what databases are for SQL-based languages. Arrays or tables as they are sometimes called can be used to store the contents of several variables and to create one, you use the following syntax: Array(key=>value) The array in the syntax refers to the ...

Cookies - not the one you dunk in milk

Thursday, May 29th, 2008

If you have been browsing the web foir quite sometime, then you might have come across cookies which allows your browser to remember passwords and other information that may have anything to do with your actions on a particular website. These can be preferences that would allow the browser or ...

Templates and ready made Apps on the Web (Part 2)

Sunday, May 25th, 2008

There are a lot of programmers who share code and sample applications which you can use for free (provided you clear it up first) but for budding programmers, they're all there for the taking. Sites like <a href="http://websitetips.com/php/">websitetips.com</a>, <a href="http://www.smartwebby.com/PHP/default.asp">Smartwebby.com</a> and many other blogs and help sites allows access to ...

Templates and ready made Apps on the Web (Part 1)

Wednesday, May 21st, 2008

Thanks to the basic foundation on which PHP is founded on, the language being free of all legalities and other stuff that makes deployment of other languages on the many platforms quite expensive. But the many people who makeup the PHP community are not ones who keep knowledge to themselves ...

Further shortening of your code (Part 2)

Saturday, May 17th, 2008

As stated in the previous entry, shortening or simplifying your source code makes it easier and better when you need to find bugs and a good example of this would be : Example : if ($Mickey == true) echo 'Welcome to the Mickey Mouse Club House'; elseif ($MainCharacter == false) echo 'Hi Barney!'; Making ...

Further shortening of your code (Part 1)

Tuesday, May 13th, 2008

Many people are using PHP for development and most have truly mastered the art of programming the easy way round. Sadly, many older web sites that used these older styles of programming are not only long but reminiscent of reading something similar to alien writing that is long and incomprehensible ...

Control Structures

Friday, May 9th, 2008

There used to be an old saying in PHP that a control structure needs a single constant to locate it and a set of brackets to clear it all up. Well, that might all be true but using too many of these curly brackets when it isn't needed at all ...

PHP - Single vs. Double Quotes (Part 2)

Monday, May 5th, 2008

Single quotes are used to define a set of characters and double quotes for variables, and as said the two are not inter-changeable and PHP will not check for a variable within single quotes. Below is a faster way of doing the same script with the simple substitution of the ...

PHP - Single vs. Double Quotes (Part 1)

Thursday, May 1st, 2008

PHP may be an easy language to use and learn but there are simple steps most budding programmers forget when it comes to coding in the scripting language of choice for web pages. The quotes, which come in single and double forms. They may seem inter-changeable but they have two ...