Sjoerd Maessen blog

PHP and webdevelopment

Archive for the ‘XML’ Category

How to accept Bitcoins donations?

with one comment

Wether you have a blog or a charitable company you may consider to start accepting donations in Bitcoins. By doing so you give people around the world an easy way to donate. Once you have a wallet with a public address  you are all set to go. When you are not familiar yet with Bitcoin, wallets or a public address, I suggest visiting the following Bitcoin site for more information before reading on.

Various ways to communicate the Bitcoin donation address
There are a few ways to communicate the donation address, all have there strong and weak points.

Plain text
One possibility is to simply list your public Bitcoin address like below:

The problem with the above method is the fact there can easily occur a copy paste error and people who are willing to donate need to know they should enter this address in their wallet.

Using a donation link
To prevent copy paste errors it’s better to use a link that automatically starts the Bitcoin client with the BTC address pre-filled. Or even the amount and a label, the amount and label are both optional url parameters.


  1. <a href="bitcoin:176dStgJnMzYRMaSP77jpTu2WnrGmsPGV5?amount=0.005&amp;label=Sjoerd">
  2.      176dStgJnMzYRMaSP77jpTu2WnrGmsPGV5
  3. </a>


Using a donate image or button
More appealing then a text link is a nice image or button. Consider changing the image below to an image that says “show some love” for your charity. This way it’s more personal.

Donate Bitcoin

  1. <a href="bitcoin:176dStgJnMzYRMaSP77jpTu2WnrGmsPGV5?amount=0.005&amp;label=Sjoerd">
  2. <img alt="Donate Bitcoin" src="/path-to-bitcoin-image.png" /></a>


Bitcoin url or wallet shortener
Another possibility is to use a shortener service that converts a Bitcoin wallet address in a shortened url. However I do feel this brings a greater risk because of the possibility the shortener service gets hacked and donations are sent to another public Bitcoin address. Examples of such services:

In the (nearby) future there will definitely come official Bitcoin user-friendly urls that can be used as an address for sending and receiving BTC but for now these services can be a great alternative.

Using a QR code
The methods above all have the same disadvantage, you have to visit the webpage with the public donation address trough a computer or smartphone to be able to click or copy paste it to you wallet. When you are fund raising on the streets people can’t click on your link and writing it down on a piece of paper won’t be very user-friendly neither. The solution for this problem comes in using a QR code. A QR code can be easily scanned by all modern smartphones, the QR code will then be translated into your public address without any change of copy paste mistakes. To generate a QR code of your public address you can use the Bitcoin wallet software on your computer or use a website like, simply enter the BTC address and watch it generate a QR code. A example or such a code can be seen below:








Accepting donations is easy like that, there’s nothing more to it, good luck!

If you liked above information, don’t forget to tryout the link below:

Written by Sjoerd Maessen

January 12th, 2014 at 7:56 pm

Posted in XML

Passing the PHP 5.3 ZCE exam

with 4 comments

I passed the PHP 5.3 ZCE exam
Today I passed the exam to become a PHP 5.3 ZCE. Like everyone else I had to sign the non-disclosure contract so I can’t go into detail about the questions that were asked, I can however tell my impressions of the exam and how prepared for it.

Differences with the previous exam
The first thing I noticed when I bought the PHP 5.3 exam voucher was that there was no option to order a bundle of preparation tests. There was however a free study guide. The new study guide can not be compared with the previous php|architect’s Zend PHP 5 Certification Study Guide. Were the new free study guide gives a quick overview (including some example questions) of each topic in the exam the original study guide starts with basics of PHP and really covers each topic thorough, except for the new PHP 5.3 features. Read the rest of this entry »

Written by Sjoerd Maessen

December 30th, 2010 at 3:54 pm

Creating XML files with DOM Document

without comments

As a first blog post I would like to have some attention for the fact that a lot of programmers are using functions and classes for doing exactly the same as what can be accomplished by using default PHP extensions.

XML files are very common nowadays and every developer needs to deal with them one day. Most of the scripts and classes used to generate XML files string use concatenation and echo to buildup XML files. Although this is a very short and quick method for simple XML files the same approach is often used with more complex XML files with namespaces. The code then often becomes bloated, unreadable and slow, so why not use the PHP 5 DOM API instead (or if you travelled from the past and still use PHP 4 try DOM XML). A quick example of the PHP 5 DOM API usage below.
Read the rest of this entry »

Written by Sjoerd Maessen

December 3rd, 2009 at 11:47 pm

Posted in XML