Archive | Programming RSS feed for this section

PHP : Array to Object

6. May 2008

10 Comments

I wrote a quick and simple function which allows you to quickly convert arrays to objects. It allows you to change an array like this :

Continue reading...

Wordpress : get_pages

4. May 2008

0 Comments

The Wordpress get_pages function works similar to the get_posts function which fetches posts from the database by criteria. The get_pages function takes different arguments and allows you to take control of parent and child pages as you execute the function.

Continue reading...

Embed Quicktime Movie

29. April 2008

0 Comments

Embedding a Quicktime movie player into your webpage work similarly to embedding Flash files, making use of the OBJECT, EMBED and PARAM tags inside your HTML code. You can play .MOV, .MP4 and .MPEG files with the embedded Quicktime movie player.

Continue reading...

HTML : Option Groups/Sections

28. April 2008

0 Comments

Have you ever wanted/needed to create a select drop down menu with options divided into sub-sections or groups with labels? See the screenshot below.

Continue reading...

PHP : Strip filename from a URL

26. April 2008

0 Comments

Using PHP, you might need to strip the path from a URL, leaving behind just the filename at the end of the URL. You can achieve this with a regular expression pattern of course, but I have a much simpler solution. See the example code below.

Continue reading...

JavaScript : Increment & Decrement Variable Values

19. April 2008

0 Comments

Using Javascript, you might want to define a variable when a page is loaded and change the value of that specific variable throughout the period of the interaction of the user with the page. You can define a variable in the HEAD section of the page like this :

Continue reading...

CakePHP : Form Radio Default Checked Value

17. April 2008

0 Comments

With the CakePHP FormHelper, you can output a set or a list of radio button widgets.

Continue reading...

CakePHP Crontab

28. February 2008

1 Comment

Due to the way that CakePHP rewrites URL requests with its router, it might seem confusing to execute a Crontab to run a controller action. I will show you how to set up a cron dispatcher so that you can execute all your different controller action schedules on a single file and pass the controller [...]

Continue reading...

PHP : Cannot use a scalar value as an array

26. February 2008

1 Comment

I was working on a Wordpress plugin today and came across the most disturbing PHP warning error which I have never seen before in all the time that I’ve worked with PHP. The warning error message was : Warning: Cannot use a scalar value as an array What caused this error was when I tried to append [...]

Continue reading...

MySQL : Transfer database from server to another server

20. February 2008

2 Comments

In this article, I will show you how to dump a mysql database from one server to another remote server without having to export and import your SQL structure and data. We’ll dump a database directly to another empty database on another, remote server. In order to do this, you’ll need shell access to both [...]

Continue reading...