Monday, April 19th, 2010
When I started programming I only learned about do ... while statements and I didn’t know about while statements. There are some times when my code would’ve been a lot cleaner if I had known about while statements. To save you all the trouble of what I had to go through I’m writing this post. For those of you who already know the difference between while and do ... while I have included a little-known trick that may interest you. Just skip on down to the bottom.
Tags: functions, loop, php, syntax, while
Posted in Programming, Tutorial | 6 Comments »
Monday, March 1st, 2010
I made this for my wife cause she had thousands of pictures she wanted to share with a client of hers. So instead of mailing a CD or using a service like flickr I had her use an FTP client to upload the files to her website in a subdirectory and then I added two files to the parent directory of her files (not the root directory of her site) and it gave her client a simple interface to browse through folders and see thumbnails of all the images in there along with any documents.
Tags: directory index, htaccess, php
Posted in Programming, Scripts, Web Tricks | 2 Comments »
Thursday, February 18th, 2010
Since PHP5 was released, PHP programmers have been blessed with a decent support of object-oriented programming. With this ability many programmers have used classes in many if not all of their projects. A very common practice for OO programmers is to place each class in an includes folder. There have been many times when I have seen a config file full of includes and/or requires. They will include every class in their includes folder whether or not they use it in a particular script. This causes many unnecessary includes.
Tags: autoload, classes, oop, php, Programming
Posted in Programming, Tutorial | No Comments »