Okay decided that the old theme wasn't really that professional and figured this looked at least a little better. Remember I'm not a designer so you'll have to put up with the amateur look! However I have pulled WordPress apart today and hacked CSS to death to get it working in Microsoft Internet Explorer. For those of you who do use it, yes I know about the broken post bar, Dave'll fix it hopefully tonight or tomorrow for me as I'm fed up of naff MSIE and it's non standards. My advice to you today is get a real browser like Firefox… Trust me it's far better! I'll be listing up my used theme and extensions soon for anyone who's interested. I've just gotta fix this site first!

What's new? Well besides the look, I've hardcoded in my top nav bar. I intend to randomise those pictures too once I've written a script and a database table to hold the images. That way I can add new ones as and when without too much hassle. Plus being small they can be off my phone (which the above all were) without a noticeable deterioration of quality. I've also created some standalone pages outside of WordPress but using WordPress's features. How? Well I tried using their Page option but it wasn't doing what I wanted and so I found a way to load all of the WP stuff with having control of the page but still being able to use their functions and classes (so I don't have to update the Archive!). I'm listing out all of the blogs, resource sites etc. etc. that I have and read so you'll have to bear with me on that one. It's a mini bookmark site for me and possibly of interest to someone out there too. I'll post how I did it later when I've fine tuned everything ;)

Now I did have a festive title image, santa hat n everything, but that seems to have got lost from the offline to online version. Not sure where it's gone, probably down to my CSS. For anyone that want's to see it now until I can get it back on the page permanently (well until Christmas is over)…

Just Stuff Festive Image

A nice little font and I coloured in the red and green!

Anyhow, I'm still fixing bits here and there but if anyone finds something that's gone a bit skewiff please be sure to comment and let me know. Of course let me know what you think of the new design too :)

Today whilst bored working hard, I started chatting to a friend who mentioned he had a web site to sell. After much deliberation (all of 5 minutes) I bought it! The site has the basic domain name known to Google but nothing more as it's currently got a blank front page, however the internal site is 99% good to go so I just need to add some underlying payment automation code to it for PayPal and in theory I could set it live as it is. I got plenty of ideas already for it however, my little brain's ticking over on money making ideas.

I'm hoping with a few sales I'll have made my money back so I'll be putting my apparently SEO knowledge to good use and getting the site indexed and as good rankings as possible as soon as possible (once the payment has cleared of course). I know because of the nature of the site it'll be a little bit of a challenge but hey, I like a challenge I do :D

PHP, if done wrongly can leave your site and subsequently the server that your site is hosted on, open to attack. There are various security measures you can take to limit the possibility of this happening.

Khalid over at Jelly and Custard has started to write a few tutorials on this subject. To save me writing them too, go read his post on Variable Casting

Once you start to write more than a couple of lines of PHP errors will undoubtedly creep in and the more code there is the harder it is to find the problem. PHP has a brilliant Error Reporting system that pinpoints the area if not the line where the problem is and also can tell you either what is missing or give you an idea of what has gone wrong.

The Error Reporting is usually turned on by default however a lot of online hosts switch this off to minimal reporting as some errors are just really warnings anyhow and won't actually break a page. When testing for yourself however it's good to know exactly what is happening and where. So if you're working offline on your own PC then you will need to ensure that the Error Reporting is set to All in the php.ini file (see the PHP documentation for this), alternatively you can put a function at the top of every page (or use an include!) to ensure it's always running and then remove it when you're happy with your site. The function to set all errors to on is:

[source:php]error_reporting(E_ALL);[/source]

There are further values that the function can take which are listed on the PHP.net site however I won't go into those.

The error suppression operator can be used in front of any expression that generates or contains a value. This is required to block errors for example going back to our form, if box1 did not have anything in it then when you came to print the variable $box1 and error would appear on screen. By putting an @ sign before the word 'print' it suppresses it, therefore if an error occurs, don't display it.

[source:php]@ print 5/0; // of course you cannot divide by zero[/source]

The Error suppression operator is handy for a quick fix and is used quite often however to have full complete code you shouldn't be suppressing the error but acting on it. For example the above print statement where 5 is divided by zero. Perhaps this was a calculation for a shopping basket script. Suddenly you realise you need to know if that is happening as there's a major flaw if it does. You could use an if statement to check for an error, and if there is an error prevent the script from processing further and contact you via an email (using the mail() function).

However whilst I've been told that using the above suppression method is a bad idea I do not see any difference between doing that or having a script that says "if the input box is not empty print the content". Afterall, unless you do something else otherwise there's no real difference except that you type and extra 2 lines of code into your script!

Operators are used in PHP for many things. Often to control a loop or if statement, they can be useful when counting, mathematical reasons and more. Below are the basic operators used and also a shorter form of them so that you have them as reference for when I hit control structures (very soon). I won't bother with examples as I think the simple ones are very straight forward and the others require examples using code I've not touched on yet. Below is more for a reference for now.

// plus
$a += $b same as $a = $a + $b
// minus
$a -= $b same as $a = $a - $b
// multiply
$a *= $b same as $a = $a * $b
//divide
$a /= $b same as $a = $a / $b
// concatenate (for use in strings to join two strings together)
$a .= $b same as $a = $a . $b
// increment
$a++ same as $a = $a + 1
// decrement (is that a word?!!)
$a-- same as $a = $a - 1
// the comparison operator (different to one equals sign, below means "is equal to")
$a == $b
// assignment operator, ie. $a becomes the value of $b - don't get this and the comparison operator mixed up!
$a = $b
// not equal to
$a != $b
// $a is less than $b
$a < $b
// $a is less than or equal to $b
$a <= $b
// $a is greater than $b
$a > $b
// $a is great than or equal to $b (note the equals sign is always to the right of the operation)
$a >= $b
// NOT operator, returns true if $a is false
!$a
// AND operator, returns true if both are true
$a && $b
// OR operator, returns true if either are true
$a || $b
// same as AND operator
$a AND $b
// same as OR operator
$a OR $b