Create reusable code assets—the page header and footer—and learn how to use PHP code to address the problem of having different relative paths to shared files.
- [Instructor] In the previous movie,…we learned to use include and require.…In this movie, we'll learn some additional techniques…that can help you to use them better in your projects.…So, the first thing I want to show you…is how we can use variables in PHP to work with these…included and required files.…Specifically, I want to be able to set a page title…on this page, $page_title…and I'm going to set it equal to,…let's just call it Staff menu.…I'll make it capital, Menu.…Okay, so I'm setting this variable, $page_title,…what I want to show you is that…that variable is available inside this file.…
It's an exactly as if that PHP code…were right in this spot.…Right at line four,…all of the content of staff_header right there.…That means we have access…to any variables that have been set.…I just want to make sure that that's clear to you.…So, here we go, let's put in a dash and let's do…echo our assigned page title.…Now, of course, we want to make sure that page title is set.…So let's go up here to the very top,…let's put in a bit of PHP…
- Organizing project files
- Including and requiring files
- Working with URL parameters
- Encoding dynamic content
- Modifying headers and page redirection
- Creating forms and processing form data
- MySQL basics
- Using PHP to access database tables
- Creating, reading, updating, and deleting database records with PHP
- Validating data
- Preventing SQL injection
Skill Level Beginner
MVC Frameworks for Building PHP Web Applicationswith Drew Falkman2h 57m Intermediate
1. Start a Database-Driven Project
2. Build Web Pages with PHP
3. Headers and Redirects
4. Build Forms with PHP
5. MySQL Basics
6. Use PHP to Access MySQL
7. CRUD with PHP
8. Validate Data with PHP
9. Prevent SQL Injection
Next steps1m 8s
- 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.