In this challenge assignment, you are asked to store messages in the session file before a page redirect so that the message can be retrieved after the redirect to let the user know the results of the previous operation.
- [Instructor] It's time for another challenge assignment.…Your challenge is to add status messages…to the application.…In the previous movie,…we used sessions to store frequently used information,…like the username.…Another good use for sessions…is to store information…that needs to persist after a redirect takes place.…Remember, a redirect is telling the browser…to make a fresh request.…It's a useful technique…to be able to store status messages in the session,…then perform a redirect…and then retrieve the message after the redirect…to let the user know what just happened.…
So to make this work,…I want you to go into the staff area,…into both staff subjects and in staff pages.…And on the new.php,…edit.php,…and delete.php pages…where we actually make changes to the database,…once a change takes effect…and we do a redirect,…you want to store a status message…right before the redirect.…For example,…when we're creating a new subject record,…you would store a message like,…"The subject was created successfully."…That gets stored in the session,…
- Creating a content management system
- Building dynamic content navigation
- Using context and function options for conditional behavior
- Hiding content from the public view
- Insecure direct object reference
- Allowing HTML in dynamic content
- Previewing content in the public context
- Working with cookies and sessions
- Storing status messages in the session
- Secure user authentication (login/logout)
- Regulating page access
- Nesting related resources
- Managing an ordered list automatically
Skill Level Beginner
1. Create a Content Management System
2. Build Dynamic Content Navigation
3. Use Context and Options
4. Cookies and Sessions
5. Regulate Page Access
6. Nesting Related Resources
Next steps1m 15s
- 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.Cancel
Take 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.