From the deep
MySQL is/was deeply integrated within PHP. No doubt you have seen and used the mysql_*() functions at some stage, but there is an alternative that makes your database interactions much more reliable. It’s called PDO (PHP Data Object) and here’s a quick guide that should get you up to speed in no time at all. [...]
I like playing the occasional game of Reversi, and thought it would prove to be an interesting project (creating something like RedHotPawn for chess). Several hours programming later I had a simple working prototype. A couple more hours later I added in some missing features and smartened everything up. Demonstration and Download To view a [...]
Quite an interesting little test, I thought. Has zero practical world application, but it does require the person to have a somewhat analytical mind and problem solving skills. Also a reasonable knowledge of PHP. So I thought I would have a go (without looking at others’ solutions). 10 minutes later a working script which does exactly what was requested.
Running through a website checking for errors is time consuming. It’s also boring and prone to human error. Unit testing has been around for years and is a much faster and reliable way to test for errors.
It was hard to track down if these two features were possible with the latest Amazon S3 SDK, but they are and have documented them for you below.
The need for encryption and decryption in general day-to-day Web programming is quite rare. But it can crop up from every now and again. I use a class that handles both encryption and decryption using mcrypt and the Rijndael algorithm (AES) and a 256 bit key size.
The autoload function is one of my favourite aspects of PHP. I’ve even blogged about it before. It makes writing code quicker and more reliable (no more typos or worrying about whether you forgot to include a class file) giving you more time to actually program.
I can’t browse the Internets these days without stumbling into some new fang-dangled state-of-the-art CSS-parsing-framework Web 2.0 (beta). And every time I see them I cringe. And to be honest they’re normally written in Ruby. Which answers a hell’uva lot of questions.
As you might have grasped from the name of the pattern its role is to produce and dispatch a product. In this case a classes. We use the Factory pattern as it is a standard way to create a class which is very similar to other classes by containing the same functions, but implemented in a different way. I always like to use non-technical terms when explaining, and this example will be no different.
So let’s jump straight in, what is a replay attack? Essentially a security breach whereby someone poses as someone else using some unique piece of data the user supplied/was issued to/from the Web server. It’s kind of similar to a man-in-the-middle attack. We’re going to be looking at the attack using specifically cookie authorisation, a very common means of implementing a “remember me” function.
Earlier in the week, whilst implementing a domain registration API into another client project (and pulling my hair out), I thought back to a seminar from university. The module was Component Based Design and it was all about writing code in a standard way, helping to aid both the supplier (API creator) and the client (the person using the API). Although I didn’t realise it until now it actually played a large role…
PHP5 reared it’s head mid 2004, 5 long years ago and all PHP developers rejoiced. Especially me. It gave us lots of new shiny tools to play with, including the obvious improved OO support and my particular favourite: the __autoload function. For all you Java developers out there you know that you never have to include or require files, the Java language instinctively knows where to find them thanks to the…
One thing I have found is the lack of really simple XML classes—that’s not to say there aren’t any good ones out there, I have used several really cracking ones. For my new version of my personal site (yes, this site is planned for a revamp) I wanted to integrate my Twitter feed somewhere. I looked and looked for a really simple XML class but was unable to find one. So I made one. And here is the result:
I recently had a client who sent me a 300+ list of items they wanted placing into a drop down select menu. Beside the obvious accessibility issues they were quite set in their ways about what they wanted—per usual.
In this first episode of PHP design patterns, we will be looking at the Singleton. The Singleton is available in most, if not all, OO languages. The purpose of the Singleton is to only ever have 1 instance of a class available which supplies the rest of the application with consistent data. I would like to point out that my version of a Singleton may differ slightly from other peoples; design patterns are not exact nor are they set in stone.
I was browsing a couple of PHP forums the other day, and it seems people require a simple authentication script for their website. So, I thought I would make just that.
There are several functions in the PHP language which were made to make classes more accessible and dynamic. I am going to be talking about two of these so called “magic functions” which allow you to set and get information dynamically, whilst also providing a simple log to show you what is really going on behind the scenes. These two functions are of course __set() and __get().
Arguably one of the best things to come out of PHP5 was its improved OO support. With OO comes easier separation of presentation, data, and business logic layers which leads to reusable code and better code management, amongst a host of others.
Over the years + From the journal
From the journal
From the deep
There are many alternatives (Balsamiq and Go Mockingbird, to name a few) and haven’t delved too deeply, but looks like a solid (free, for now) alternative.
Handsontable is a minimalistic approach to Excel-like table editor in HTML & jQuery. Now with column and row headers!
Making good-looking graphs shouldn’t be hard. Morris.js is a lightweight library that uses jQuery and Raphaël to make drawing time-series graphs easy.
Git allows groups of people to work on the same documents (often code) at the same time, and without stepping on each other’s toes. It’s a distributed version control system.
Seems as though the jQuery team are planning on dropping support for IE 6/7/8 in jQuery 2.0, expected to be released in early 2013. Now, although I don’t particularly like IE, I think that might be a little too aggressive a development path. Unfortunately few people still use IE 6, a little more 7, and quite a chunk 8.
I am thrilled to announce the arrival of a new stable version of Node.js. Compared with the v0.6 releases of Node, this release brings significant improvements in many key performance metrics, as well as cleanup in several core APIs,
Researchers have clocked light beams made of “twisted” waves carrying 2.5 terabits of data – the capacity of more than 66 DVDs – per second.
Ratchet is a component library for PHP that provides developers with the tools to create real time, bi-directional applications between clients and servers. This is not your Grandfather’s Internet.
Test your regular expressions with live matching and custom string matching.
Google Maps users may soon find it easier to plan a trip on some of England and Wales’s waterways. The search engine has teamed up with the Canal and River Trust, a charity that will be in charge of the two countries’ water network from July.
We have been meaning to add this kind of functionality to Signable for a while. Will have to add it to the ever-growing todo list.
Resize your browser to reveal just a handful of the kind of devices you should expect web pages to be viewed on.
Still no real “hands on” with the newly announced Microsoft Surface, but it looks as though it will integrate well into their product line since it runs Windows 8 (whether that will be a full or stripped version is as yet unknown).
PlayThru is the next generation of online human verification. It is designed to be more simple, more intuitive, and more fun than the current CAPTCHA options. We use game mechanics to create an experience that is more enjoyable than solving that awful squiggly text.
I have actually created this exact plugin for our internal CMS – I might look into releasing it into the public after this.
Not sure how manu years Linux users have waited for an update, but it seems to finally be here!