A simple function to easily process a website or file and return an array of all the URLs found. The main purpose I created this was to make it easy to process “Directory Listings Pages” which is a page which shows all the files and folders in a websites directory if there inst a default/index
Continue reading...
Comparing two bits of data in PHP is quite simple but there are special occasions when a simple comparison of data needs to be slightly different. One of the common issues is comparing float numbers, a common mistake is comparing two float numbers the same way in which you would compare two integers or two
Continue reading...
Screen is useful tool but it does have some slight bugs such as when you use the SU command to switch to another user and attempt to use screen you will most probably receive a error message similar to the following.
Continue reading...
Eclipse is a brilliant programming interface for many languages but when using a Windows 7 based PC you may have issues when pinning the shortcut to the task bar. As you can see below when I launch eclipse via the shortcut instead of using the pinned icon it creates a new one. If you right
Continue reading...
Normally if a visitor requests a file or folder which doesn’t exist your web server will respond with a 404 file not found error message, this isn’t the best looking error message and so it’s common to setup a redirect so instead of the web server showing the default page you can use a custom
Continue reading...
Optimization is a key part of any website we need to keep it loading quickly for the sake of keeping visitors and also for lowering server stress. With internet connections becoming faster most developers skip optimization but mobile broadband and phones are growing rapidly which still have a relatively slow connection when compared to the
Continue reading...
Sometimes as a web developer I have to capitalise the first letter of each word normally for title and header tags but I don’t want to have to sit there manually capitalising each letter. HTML and CSS don’t have a native feature which allows you to quickly capitalise the first letter automatically so we have
Continue reading...
JavaScript is a powerful tool for a website but to extend the capabilities and functionality extra libraries can be included, the most commonly used libraries are jQuery and Prototype. Normally a website will choose either of these libraries but sometimes both libraries are required, if this is the case a small change needs to be
Continue reading...
Ever had to check if a record exists using SELECT then perform an INSERT or UPDATE based on the result? Why not combine both the INSERT and UPDATE into one command and remove the SELECT query checking with one easy MySQL feature. Instead of performing two or three queries we can perform just one which
Continue reading...
There are multiple ways to redirect a domain to another domain but in this post we will be using mod_rewrite rules which are normally specified in the .htaccess file (you can learn about this file in this post). There are other redirect methods but these are past the scope of this post and will be
Continue reading...