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 - PHP Tutorial
From the course: PHP for Web Designers
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
How PHP makes decisions3m 30s
-
(Locked)
Changing output depending on the current time9m 1s
-
(Locked)
Adjusting the server's time zone8m 57s
-
(Locked)
Displaying an up-to-date copyright notice6m 18s
-
(Locked)
Challenge: Displaying an image of the month2m 15s
-
(Locked)
Solution: Displaying an image of the month5m 12s
-
(Locked)
Understanding what PHP treats as true and false2m 57s
-
(Locked)
-
-
-
-
-