I put this block of code together for some freelance work I’ve recently completed, where the client needed to be able to have dynamic control of content and assign these pieces of content to various files in the website. The easiest way to do this, especially for future expansion, was to use the following code to generate a list of all files in the directory.
Read the rest of this entry »
You may have noticed, you may not, but when you go to www.andrewgatenby.com your browser is automatically bounce to andrewgatenby.com - no “www.” in the domain name. This is something I’ve actively done is to include what is called a canonical domain redirect. Basically, if you have a www.domainname.com then you can probably also visit your site by just going to domainname.com and it will still show the same content right?
Well, this to a search engine appears as 2 different domain names with the exact same content - something which could get you marked down in rankings. Using the modern-day witchcraft that is .htaccess we can solve this problem, and automatically bounce domainname.com to www.domainname.com by issuing a HTTP 301 (permanently moved) header redirect:
Read the rest of this entry »
As someone who works with websites for a living, and then again until the small hours doing freelance bits, I have to say that I love the internet. It’s something that lets anybody can create a blog to share their thoughts, upload their holiday photos, or catch a sneaky episode of South Park on YouTube.
It may be a bit presumptuous to say at this point - but I’ve every faith that you enjoy using the internet too. Am I right?
People make sure they have all the necessary plugins like Flash, Quicktime and possibly even Java so they can see clips of cats dancing on YouTube, listen to your friends band on Myspace and catching up on the latest news.
So why do people insist on using an outdated web browser?
Read the rest of this entry »
PHP lets developers output strings to the screen using single or double quotation:
print ‘Hello world’;
print “Hello world”;
Both of these statements product the exact same output to the screen in terms of what the browser sees. However, these is a distinct difference in how PHP handles these statements.
Read the rest of this entry »
Recent Comments