News and Blog

Preventing Direct File Access Using a .htaccess File

September 29th, 2010 - Posted by Steve Marks to Web Development.
Preventing a user or bot from directly accessing files within a directory can be a very useful trick, especially when the files in question contain sensitive information or when a user must pay for the file prior to getting access. Deny access to everyone To protect your files you must fir...

Reasons to Validate your HTML Web Pages

September 28th, 2010 - Posted by Steve Marks to (X)HTML / CSS, Web Development.
Before I begin to list the reasons why you should validate your websites, lets take a step back and look at what validation actually is. What is W3C Validation? Validating your webpages means updating your code (ie. HTML and CSS) to meet the technical specifications and guidelines outlined...

Get a Page URL with JavaScript

September 28th, 2010 - Posted by Steve Marks to Javascript / jQuery, Web Development.
Sometimes it’s necessary to perform actions based on the user’s current URL, and the page that they are viewing. If doing this dynamically after the page has loaded then JavaScript provides a method to get the current website address, and more. Firstly, lets look at a very simp...

Perform a Mass MySQL Find and Replace in a Single Query

September 23rd, 2010 - Posted by Steve Marks to MySQL, Web Development.
If you haven’t heard of the MySQL REPLACE() function before then add it to your toolkit because I’m pretty confident you’ll need it again at some point. It’s saved my a** numerous times now and saved me hours of manual work. For those of you reading this that are fa...

Reasons Why a HTML Form Might Not Submit

September 23rd, 2010 - Posted by Steve Marks to (X)HTML / CSS, Javascript / jQuery, Web Development.
I’ve had it lots of times throughout my career; you build a form and it will not submit. I know how frustrating this can be so I’m going to outline a few reasons why this might be below: 1. Check your HTML Structure In order for a standard HTML form to submit successfully it re...

Foreign Characters in Javascript Alert Showing Question Mark In Diamond

September 22nd, 2010 - Posted by Steve Marks to Javascript / jQuery, Web Development.
You include a foreign character, for example à è ç ü, to a Javascript alert popup and it comes out as a question mark in a black diamond as follows: Does this sound familiar? If so, I know how frustrating this can be because it took me hours to find a way to resolve this. [...]...

Opening PHP Tags Not Being Recognised

September 20th, 2010 - Posted by Steve Marks to PHP, Web Development.
A block of PHP code can be started using an opening tag of either ‘<?php’ or ‘<?’. The latter, also known as a short tag, is generally not recommended any more due to the widespread use of XML and can result in the server parsing the wrong code in the wrong co...

Removing the Query String from a .htaccess Redirect

September 17th, 2010 - Posted by Steve Marks to PHP, Web Development.
Are you doing a URL rewrite using a .htaccess file but the query string is being carried through also to the new URL, even though you haven’t specified it using QSA (Query String Append)? To prevent this additional query string being appended to the destination address simply add a q...

Swap and Re-Order Divs Smoothly Using jQuery – Swapsies Plugin

July 9th, 2010 - Posted by Steve Marks to Javascript / jQuery, Web Development.
Well, it’s about time but I’ve finally taken the plunge and wrote my first jQuery plugin. I’ll admit, the decision wasn’t voluntary but a scenario on a recent project required a specific function that I couldn’t find had been previously catered for so I decide...

Using jQuery’s jCarousel Lite and Thickbox in Harmony

July 7th, 2010 - Posted by Steve Marks to Javascript / jQuery, Web Development.
There are two jQuery plugins that I probably use more than any others. These are jCarousel Lite by Ganeshji Marwaha and Thickbox by Cody Lindley. jCarousel Lite – This plugin allows you to navigate images and/or HTML in a carousel-style widget. Thickbox – Designed to show a sin...