…In the previous chapter, we used the date function to…get the first three letters of the current month's name.…The codes there on line two in index.php in the Hansel and Petal site.…And we used it to display an image of the month.…However, if we go down to where that image is in the HTML.…There it is down here.…We can see that the alternate text is still hard-coded.…And it says fresh tulips.…Armed with the knowledge you've gained about arrays, I'd like you to think about…how you might go about changing the…alternate text so that it matches the image.…
Now, to help you, if you go to…the handp_check folder, Open that and go to 04_03.…In there is a text file called alternate.txt.…And that contains…some suggested alternate text for each month.…There are actually quite a few ways you could do this.…The challenge isn't to find the most sophisitcated approach.…All you need is something that works.…Take a look at the online documentation for the date function.…
Take a look at the formatting characters, and see if you can find something…
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
-
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: Challenge: Inserting the appropriate alt text