Top 25 Most Dangerous Programming Errors

Security has always been an issue in software development; mainly due to ignorance, laziness and a nonchalant attitude of programmers (I’m one of the guilty ones). ‘Security’ is the one section in a project scope that gets consistently ignored by not only the developers but also management. In defense of myself and other programmers I would have to say that writing secure software is hard work, and with all the pressure from management and clients to get the software delivered, its no wonder that programmers turn a blind eye towards security. But that is surely not an excuse to deliver a product full of security vulnerabilities.

Read More

Creating a .htaccess file on Windows

Everyone who has tried creating a .htaccess on windows knows that Windows Explorer does not accept the ‘.’ character as the first character of a file. For most of you this may be old stuff, but for the newbies, the quick way to create the file is to open the command prompt and type:

copy con .htaccess [press enter]
[press ctrl Z]

The second way is to:
Open notepad and save the document with file name .htaccess with the ‘save as type’ set to ‘All Files'; or save the document with file name as “.htaccess” including the quotes.

Read More

Quick way to determine if php is running at the command line

Many times it is necessary to determine if the php script is running on the command prompt. Recently I wrote a php shell script which could also be run from a browser and needed to decide in the code if to output a '\n' or a ‘html break’ after a text line.

The following simple function returns a true if the script is run from a command prompt and false otherwise.

Read More

Filter your wordpress content by location

Today I’ve released my first WordPress plugin, Country Filter. The Country Filter plugin allows you to control the visibility of WordPress elements depending on the users country of origin. You can hide or show certain elements of a page or some sections of a post from users browsing from a particular country. For example you could have a ‘donate’ button that displays only if the user is browsing from France, India or UK.

Plugin download and installation instructions can be found here.

Read More