From the course: PHP for Web Designers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Displaying an image of the month

Challenge: Displaying an image of the month - PHP Tutorial

From the course: PHP for Web Designers

Start my 1-month free trial

Challenge: Displaying an image of the month

It's time to put you new found knowledge to the test. The challenge is to see if you can work out how to display an image of the month in the home page of the Hansel and Petal website. If you scroll to the bottom of the page, you'll see there's a photo of tulips, and it's labeled seasonal specials. This is what I want to make into the photo of the month. I would like you to adapt the code in index.php so that a different photo is displayed each month, and let's have a look at the HTML in index.php to see what's involved. The code for the image is on line 83. And you can see that it's got a very long name. Obviously we're going to have to change that if we're going to have a different image each month. It's also got alternate text, and the height and the width are declared there. Now let's have a look at the images folder. And you can see that at the bottom here, are 11 images that being with special_ and then three letters, the beginning of a month. And the one that's missing is for…

Contents