So far in Webmonkey, you've seen how PHP can be used for databasing and site navigation. It's pretty bland. In this article we're going to leave that dry stuff behind and concentrate on PHP's image-creation abilities.
Sometimes it's good to use images for your form's Submit button and for other links on your page. That way you can control their size and appearance. Maintenance can be a pain, though. PHP, as we'll see, can make it a bit easier.
The image functions in PHP will let you build GIF images on the fly, either out of pure code or by building on an existing image. We'll look at both possibilities here.
Take a look at this example. Input your own text in the form and see how it works. You'll notice that the images reflect the text you entered in the form. If the banner the monkey holds doesn't get updated with the other images, you may have to force an image reload.
Let's walk through most of the code to see how this is done. I'll start by looking at the main file here, button.phtml.
next page»