Archive

You are viewing all articles posted in “PHP”

Recent articles can be found on the homepage.

Generate unique slugs in CakePHP

posted on 23 October 2008 (10:41 AM)

I believe it was Wordpress who came up with the term "slug". It has been adopted by many other systems though, and it basically means the following: a unique identifier which can be used in a URL to create a permalink to a page.

At least, that's my interpretation of it. In this article I will show you how you can generate a unique slug easily when working with the CakePHP Framework.

Read more

How to send multiple values through one form button

posted on 04 July 2008 (09:28 AM)

Sometimes you want to have a form with multiple "actions". For instance, in a webshop, you want to list all your products, each paired up with an individual submit button to add that particular product to a shopping cart.

But how can you, on the server-side, differentiate between products?

It gets even more difficult when you have lots of hidden data you wish to send alongside the name or id of the product, but you want to show only one button.

There are a couple of ways to achieve this, all with their own pros and cons. Below I will list some options.

Read more

WhatPHP is now live

posted on 13 July 2007 (02:50 PM)

I wanted to do this for a long time: set up a repository for myself with all my often used PHP classes, so I have easy access to the latest versions and whatnot.

This has now happened. This week I put together a little something to browse my package directory and auto-generate API information and stuff.

I thought others might benefit from it as well, so I've made it public on whatPHP.net.

Read more

Subcookies, the PHP version

posted on 29 May 2007 (01:54 PM)

As a follow-up to my last article, Take your cookies to the next level with Subcookies, I wrote a PHP equivalent.

Read more

Simplify function arguments

posted on 30 January 2007 (01:10 PM)

Sometimes functions ask for a lot of arguments (or parameters). Even when using functions you've written yourself, it's sometimes hard to keep track of the order in which the arguments are expected.

In this article I will explain a technique that makes argument-order redundant and might make your programming life easier.

Read more

Fighting spam using MySQL and PHP

posted on 27 December 2006 (07:14 PM)

Spam is a terrible, terrible thing. And I'm not even talking about spam emails. Luckily, I don't receive a lot of Viagra, free offers or casino coupons in my mailbox, so when that happens, I just send them straight to the trash bin.

I'm talking about comment spam. This form of spamming is even worse, 'cause it's out in the open, where everyone can read it, polluting innocent websites that have got nothing to do whatsoever with that malicious content.

In this article I will provide a way to arm yourself against this criminal behaviour.

Read more

Displaying search results with PHP

posted on 30 August 2006 (03:23 PM)

In this article I will explain how I've accomplished the look of my search results when someone uses the search box on the right. I'm not talking about styling through CSS, but about formatting them on the server-side.

Read more

Preferences

These settings will be saved for your convenience.