Archive for October, 2006

Embedding YouTube Movies in XHTML

Friday, October 27th, 2006

YouTube If you try to embed a YouTube-video in a XHTML 1.0 compliant website, you will get validations errors. This is caused by YouTube’s use of the <embed> tag, which has been deprecated in XHTML 1.0.

The standard YouTube code is:

To solve the validations errors we have to get rid of the deprecated <embed> tag.

Therefore we add a data attribute to the <object> tag. The following code is the most simple and will work in Opera and Firefox:

To get it working in MS Explorer we need to add a <param> tag with name and value attribute:

To autoplay a movie simply add “&autoplay=1” to the url:

Easy isn’t it? The code in xhtml is even shorter than the standard YouTube code.

Parsing newsfeeds with XSL (1)

Wednesday, October 11th, 2006

Magpie is a very popular RSS parser for PHP. Although I used Magpie quite a while to my satisfaction, it suffers a few flaws. At first it seems to have problems with the UTF8. Dealing with UTF8 is not easy in PHP (and MySQL). And there is verbose code, you feel it can be done quicker and simplier. We will parse feeds with only 5 lines of code and a simple stylesheet.
(more…)

Localizing Ubuntu

Tuesday, October 10th, 2006

Ubuntu is a Debian based Linux distribution. In its few years of existence it made quite an impression by its support and speed of development. If offers the advantage to Debian in the way it supports the modern and rare hardware. I had no problem installing it on a new Dell right out of the box. I use the server version of Dapper Drake 6.06 on my PHP server. Once you have installed the OS, you can run into problems localizing your system. I wanted to have Dutch dates on my Dutch website and English dates on my international sites. The way to add support for different languages differs quite a bit from earlier Ubuntu versions, because ‘dpkg-reconfigure locales’ doesn’t work. But once you know the secret is not difficult at all.
(more…)

Your are browsing
the Archives of My Beloved PHP for October 2006.
Categories
Archives
Links