PHP lessons

Over the passed few months, I have received numerous comments from people, on the same course as me, to the effect that they wished I would teach them PHP.

I have decided to call their bluff and offer to run classes during the summer. Well, I have been surprised by the overwhelming response and have set up a private area of my website to facilitate the lessons.

If you wish to know more, Contact me.

PHP exam & certification

A couple of weeks ago I took a PHP exam as part of my university course. Results came out last week and I was pleased to be awarded 82% – top of the class!

This is all very good and something to be happy with, but, would it be recognized by industry?

Certification

I guess the best thing to do would be to ensure I have the qualifications that employers would recognize. So, I think I am going to get official industry recognized PHP certification – as soon as I can afford it though. I remember from when I got Lotus Domino certification that it normally costs several hundred €uros. I’m poor. I can’t afford that!

MD5 Encryption

If you need to use message-digest algorithm 5 (md5) to encrypt words or phrases, please feel free to use this tool I created for my own use:

Design Coding Vid

Excellent rap vid by a guy called m0serious. Telling us all how to code clean and the importance of doing so.

Internet Explorer and CSS Box Model

Had a conversation with a Web Team Leader a while back and he asked me what I knew about the difference between how IE interprets the CSS box model and how Firefox inteprets it. I had to embarrassingly admit my ignorance in this area. The other person was suitably unimpressed. So I decided to find out about it.

The issue arises because IE includes the border and padding as part of the width of the content as opposed to adding it on. Example:

.class {
width: 25%;
margin: 5%;
padding: 2%;
border: 2%;
}

In the above rule, IE will set the content width as 25%, but the padding and border will be within that 25%. So, in reality, in IE the content width will actually only be 21%, which will be smaller than in Firefox.

The solution

Have a look at my previous article on CSS hacks.

.

Search Engine Friendly URL’s

Ok. I’m going to try to KISS this article.

I realised that I needed to change the URL’s on my website. They were similar to this:

  • www.domain.co.uk/genericpage.php?pagename

This method allows for a degree of dynamism. It allows for just one page to display all the content. Everything after the ‘?’ are arguments with which my script selects content to be shown. Great, isn’t it? Not according to search engines or the human mind.

The Solution

What I needed to do was change these into search engine friendly URL’s, as Google had only indexed my home page. So here is what I did:

  1. Create a file in notepad called ‘.htaccess’
  2. Add the following lines to the file
    • RewriteEngine on
    • RewriteRule ^skillset(.html)?$ /publish.php?Skillset
  3. Repeat the RewriteRule for each URL you want to mask

The first line turns on the rewrite engine on the Apache server. The second line creates the rule. Everything up to the ‘$’ is what is requested by the browser. Everything after it, is what is returned by the server.

  • ‘^’ represents http://www.domain.co.uk/
  • what appears in ( ) followed by ‘?’ means that it may or may not be present

So, what my .htaccess file achieves is that either of the following requests:

  • www.domain.co.uk/skillset
  • www.domain.co.uk/skillset.html

will return – www.domain.co.uk/publish.php?skillset, yet the address that appears in the location bar is the one entered by the user. Much tidier than javascript redirect or obselete frames.