CORRECTLY POSTING BOOLEAN VALUES IN JQUERY

When I’m building Javascript/jQuery based webapps, my go-to method of performing AJAX requests is via jQuery .post() using JSON. My code normally looks something like this… var postUrl = ‘/someurl.php’; var postData = {’id’: 123, ‘data’: ‘xyz’, ‘bool’: true}; // … Continue reading

REMOVE THE WORDPRESS ADMIN BAR IN YOUR THEME

I don’t know who decided to include the admin bar by default in your theme/front end when logged in to WordPress, but I find it really irritating when laying out a new theme. I just want to see how my … Continue reading

ALLOW PHP TO SEND MAIL IN FEDORA

Just run into this one as I’ve been configuring a new server. On a fairly standard Fedora set-up it’s likely that the reason you can’t send emails from a PHP script is in fact because SELinux is stopping  Apache (httpd). … Continue reading

TIME ZONE CONVERSION USING PHP DATETIME CLASS

Following on from my post last month about problems with PEAR daylight saving, here’s a quick example of using the PHP DateTime Class which was introduced recently (PHP 5.2). Convert from UTC to Europe/London local time: $time_object = new DateTime(’2011-04-19 … Continue reading

PEAR DATE DAYLIGHT SAVING BUGS

The clocks went forward in the UK last night and fortunately I was working on a site today which involved manipulating dates and times between timezones so I immediately noticed a problem in PEAR Date that I have been using … Continue reading

UK DATES AND STRTOTIME

In PHP, strtotime cannot parse the UK date format (i.e. 30/02/2011) as there’s no 30th month. Here’s a quick fix I came across that seems to work for me (so far)… Just replace the “/” with a “-” before parsing … Continue reading

INTERNET EXPLORER CANNOT DOWNLOAD…

“Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.” Seen this before? I have, and I recall it being a bug on IE6. I may … Continue reading