Join David Powers for an in-depth discussion in this video Solution: Displaying an image of the month, part of PHP for Web Designers.
…Here's my solution to the challenge of displaying an image of the month.…The first thing to do is to get the name of the existing image…of tulips from the HTML at the bottom of index.php, and then change it.…There's the image, it's on line 83.…It's name begins with 450_2_tulip. That…should be sufficient to find it. So let's go to the Images folder and…there it is 450_2. Yep that's it.…
So we need to change that name to special_apr.jpg.…And if we now look at our files, our images, we've got 12 images.…All of which begin with special underscore, followed…by the first 3 letters of the month.…So we can now go back to our editing program.…And we need to change the image name here. We're going to select that, delete…it, and insert special_, because that's the way that each name begins.…
And then we have a PHP code block.…And we're going to echo the months name.…We don't yet have a variable for that, but we'll call it months name.…And then the closing PHP tag.…It's very important to make sure that…there is no space between the underscore and…
Author
Released
12/9/2013Note: This course was recorded with Adobe Dreamweaver, but you can use the code editor of your choice to follow along.
- How to use PHP in a webpage
- Storing and displaying text and numbers in variables
- Using functions
- Adding comments to your PHP scripts
- Moving common page elements to include files
- Displaying different content on a page
- Working with multiple values in arrays and loops
- Getting form input sent by the POST method
- Using PHP sessions to preserve data
- Storing data in session variables
- Connecting to and querying a database
- Handling errors
Skill Level Beginner
Duration
Views
Related Courses
-
Introduction
-
Welcome1m 30s
-
Using the exercise files5m 13s
-
-
1. Introduction to PHP
-
How to use PHP in a web page6m 43s
-
2. Using Server-Side Includes for Common Page Elements
-
3. Using Conditions to Change Page Output
-
How PHP makes decisions3m 30s
-
-
4. Working with Multiple Values in Arrays and Loops
-
Labeling array elements7m 21s
-
5. Getting User Input from a Form
-
Calculating the order total6m 34s
-
6. Displaying Content from a Database
-
Loading data into MySQL5m 37s
-
Connecting to the database7m 47s
-
Querying the database6m 15s
-
Linking to a details page2m 40s
-
-
7. Handling Errors
-
Dealing with PHP errors4m 15s
-
Tracking down parse errors4m 32s
-
-
Conclusion
-
What's next?2m 26s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Solution: Displaying an image of the month