Lately, I’ve seen an increased attack of bad people trying to run XSS exploit on this website using _PHPLIB[libdir] exploit. It alarmed me a bit as I didn’t really know about that particular exploit. Obviously I wanted to make sure that my site is not vulnerable for it. So I did a little bit digging.
For [...]
Posted on July 21st, 2009 under PHP, Security • No Comments
If you Google around for php compare 2 dates, (at the time of this writing) typically they suggest for you to convert the date string into some integer using mktime() or strtotime(). Both the functions returns you Unix timestamp.
Understanding Unix Timestamp
In my other article, I mentioned that one of the golden rule of programming is [...]
Posted on July 11th, 2009 under PHP • 10 Comments
A lot of times, I saw programmers use COUNT(*) and check if the result is greater than 0 to see if a particular record exits in a table. If your only purpose is to know if a record exists or not and you don’t really care about how many matched records are there, the better [...]
Posted on June 30th, 2009 under General SQL • 3 Comments
A development tools such as Microsoft Visual Studio has debugging feature built-in where you can step through the code line by line and watch the variables. There are times when you may want to do the same thing with PHP script running in a remote (or it could be local as well) web server. It [...]
Posted on May 21st, 2009 under MacOS X, PHP • 2 Comments
I needed to do this when I want to debug my scripts for memory usage. My problem at that time was that as I include libraries, for some reasons PHP uses more memory even though I haven’t run a single code (other than require_once).
So my idea is to add memory_get_usage() function call on the beginning [...]
Posted on May 5th, 2009 under General Unix, Quick Tips • No Comments