See the “How to use” documentation at
more details about using sIFR.
After adding this last bit of code, you’re done! Your page will now work by default with replaced text. If
Stewart Rosenberger’s Text Replacement Method
script on-the-fly, so you don’t have to build the images yourself. It is otherwise very similar to sIFR.
For this technique to work, there are two prerequisites:
The PHP server must have the GD2 library installed. This is PHP’s image manipulation library,
and you can learn more about it at
You need to have access to the font file of the font you want to use, because you’ll need to copy
it in your web site folder.
Assuming these two conditions are met, you can go on and modify the
script that you
created earlier in this chapter, and have its header replaced by graphically rendered text when the page
loads. Figure 6-10 shows how the page will look after the exercise is completed, and Figure 6-2 shows
how the page looks right now.
Replacing Text with Images
Start by enabling the GD2 PHP library, which you need for generating images on-the-fly with
PHP. If you set up your machine as described in Chapter 1, you have GD2 already installed, but
it may not be enabled by default. Open for editing the
configuration file. In the typical
XAMPP configuration, this file is located in the
folder. In other scenarios,
you’ll find it in your Windows folder.
replaceElement() Parameter Description
Left padding in pixels.
Parameters to send to the Flash movie. When multiple parameters
are used, separate them by
. Supported parameters are
Set this to
to transform the text to uppercase, and
transform the text to lowercase.
Supported values are
(the default) and
enable transparent background).
c06.qxd:c06 10:55 137