So after a little hacking at lunch today, I discovered just why half my websites don’t work. It’s a very simple reason…
PHP4 vs. PHP5.
Yes, Newnet are still stuck in the year 2000, and are using the “favourite old shoes” version 4 of PHP. Please, Newnet, PLEASE upgrade to PHP5. Not for me, but for the sake of your hosting service. Not to mention the fact development for PHP4 actually stopped seven months ago! Not only that but security updates will be stopping in August apparently! Surely that’s two really big reasons to upgrade.
And that goes to every other webhost stuck on PHP4. At least provide two hosting options - one PHP4 for those developers stuck in the year 2000, and a PHP5 option for those developers who are modern and up-to-date.
This article is a good debate.
This article I found on the Mind Tree Blog sort of covers old ground for me, but it was interesting nonetheless. It’s interesting the way he doesn’t forward specific things, but rather everything in the URL… so we’d forward something like:
http://www.asgrim.com/channel/Google/news/something/
to:
http://www.asgrim.com/index.php?p=channel/Google/news/something/
and letting the PHP script decode the specifics of the URL, rather than setting up specific forwards like:
http://www.asgrim.com/index.php?module=channel&provider=Google§ion=news&article=something
I’m not sure which I prefer. The method mentioned in the article does give extra flexibility without having to modify the .htaccess, but the latter gives more specification as to how the URLs should work. I guess at the end of the day it’s up to opinion.
Everyone already knows about the server downtime when they were trying to break the record blah blah.
The botch I’m talking about is my experience of downloading it this morning and trying it out.
My experience was about 15 minutes…
- 1 minute to download Firefox 3
- 1 minute to install Firefox 3
- 1 minute to find out half of my add-ons don’t work
- 1 minute to try and hack the MaxVersion to work and fail miserably
- 2 minutes to locate a Firefox 2 installer
- 3 minutes to download it from the stupidly slow FTP
- 1 minute to uninstall Firefox 3 and install Firefox 2
- 2 minutes to find out Firefox 2 kept crashing because the Firebug I upgraded to crashes it
- 1 minute to uninstall Firefox 2 and re-install it
- 2 minutes to set it up back to the way I like and restore my previous profile
I think I’ll leave Firefox 3 for a little while to get rid of teething issues.
I’ve always used fancy tools like PhpMyAdmin to create users in mysql etc. as I don’t normally remember the syntax.
Here it is:
CREATE USER 'username'@'hostname'
IDENTIFIED BY 'password';
GRANT USAGE ON * . * TO 'username'@'hostname'
IDENTIFIED BY 'password'
WITH
MAX_QUERIES_PER_HOUR 0
MAX_CONNECTIONS_PER_HOUR 0
MAX_UPDATES_PER_HOUR 0
MAX_USER_CONNECTIONS 0 ;
For each database you want the user to access, do:
GRANT ALL PRIVILEGES ON `databasename` . * TO 'username'@'hostname';
This basically means: create a user, with password “password”, don’t allow them to access anything except USAGE. Then, allow them to do anything they want in database “databasename”.
I was sent a link to a Microsoft KB article which related to IE8’s new standards compatibility mode. When I read through it, I don’t know why or what made me laugh, but I found this quote amusing and just had to make a picture out of it.
Internet Explorer 8 Beta 1 end-users can work around these issues by pressing Emulate IE7 on the menu bar in the browser window. When the Emulate IE7 button is depressed, Web pages will display in Internet Explorer 7 Standards mode.
Oh noes! The Emulate IE7 button is depressed! Must get him some prozac…

Over the past few days a war has broken out in the attic part of the office here at Netbasic. Jon and myself are now warring over handsets in extreme demonstrations. Initially, the culprits were simply knocking the opponents’ handset from the phone’s cradle, but it has escalated to total removal of handsets from the phone. The war began when I removed Jon’s handset and taped it to the underside of his desk. Unfortunately, due to my dire lack of taping skillz, the handset became un-stuck and dropped during an intense match of Team Fortress 2. In response to this, I again removed his handset and hid it last Friday in the server room, so he had to make do without a phone for the entire day.
The pinnacle of the war has happened today when I went out for some “fresh air†and came back to find a message from my girlfriend on MSN claming that Jon had stolen my handset. Luckily, she saw the entire stunt on my webcam which I have set up, so he was caught red-handed. I just hope this doesn’t elevate into a full-scale phone war.
OK, this is basic PHP stuff really, but it’s something I don’t use very often so I thought I’d add a little note to remind myself.
HTML:
<form action="<?=$_SERVER['PHP_SELF']?>” method=”post”>
<select name=”test[]” multiple=”multiple”>
<option value=”one”>one</option>
<option value=”two”>two</option>
<option value=”three”>three</option>
<option value=”four”>four</option>
<option value=”five”>five</option>
</select>
<input type=”submit” value=”Send” />
</form>
PHP:
<?php
$test=$_POST['test'];
if ($test){
foreach ($test as $t){echo ‘You selected ‘,$t,’<br />’;}
}
?>
Source: http://onlinetools.org/tricks/using_multiple_select.php
Something I’ve not really played around with but I may do in the near future…. a very helpful info page about Apache’s mod_rewrite stuff:
http://corz.org/serv/tricks/htaccess2.php
OK, so this is going to be a very uninteresting post, but I used the printer for my first time ever at Netbasic. I am only writing this because Sii held me at knifepoint and told me I had to blog about it or he would kill me. So here it is.
I found an interesting helper function today through the PHPDeveloper.org feed.
It’s as simple as the topic suggests - it’s a function that takes an XML formatted string and returns an array containing the results. Using the example from Michael’s msbware.com:
Example source XML:
<xmlData>
<author>
<name>John Doe</name>
<magazine>Time</magazine>
<magazine>National Geographic</magazine>
</author>
</xmlData>
Example result array with:
[xmlData][author][name] => John Doe
[xmlData][author][magazine][0] => Time
[xmlData][author][magazine][1] => National Geographic