How to use a hidden input to distinguish multiple forms on one page and how $_REQUEST works
Chapters
- 25:59Series Introduction and Your First PHP Script
- 45:57Working With Strings and Variables in PHP
- 1:46What an IDE is and the benefits of using one
- 2:12How to work with white space and comments
- 4:41How to work with strings
- 2:44How to use a variable
- 7:04How to work with string, number and boolean variables
- 5:56How to identify and fix common syntax errors
- 2:49How a PHP function is structured and how to use strstr()
- 3:03How to use the string functions nl2br(), trim() and strlen()
- 1:38Practical uses for strstr(), nl2br(), trim() and strlen()
- 3:39How to use additional string functions like str_replace() and strip_tags()
- 3:03How to use the date() function to display a readable date
- 6:01How to read a PHP.net function page
- 1:21String function challenges
- 31:55How to Work With Arrays in PHP
- 40:08Logic, Control Structures and Looping
- 1:30What logic is and how we're approaching learning it
- 3:32How to use an "if" control structure
- 4:35How to use an "if ... elseif" control structure
- 6:08Incorporating what we know about arrays and control structures in a random generator script
- 5:51Adding additional elements of randomness to our random generator script
- 3:36How to use a "foreach" loop
- 6:43How to use a foreach loop to generate an HTML table from an array
- 4:37How to use a "while" loop
- 1:00How to use a "for" loop and how it compares to "while"
- 2:36How to modify PHP settings with the php.ini file and stop runaway scripts
- 74:49Creating Custom Functions and Working With External Data
- 1:13Why separating data from logic is important
- 6:12How to use include() and include_once()
- 1:55Moving our data into a user-friendly text file
- 3:54How to use an output buffer to store data from an external file as a string
- 5:34How to create a parser that converts a comma-separated string (CSV) into an array
- 3:09How and why to create a simple custom function
- 1:35How to create a function that accepts parameters
- 4:05How to create a function that has optional parameters and build a virtual dice roller
- 1:46A deeper explanation of the purpose of custom functions
- 4:14How to work with references in a function (i.e. variables with an ampersand)
- 1:39A quick summary of what we've covered so far, and what's to come
- 3:22How to wrap existing code in a function
- 5:38How to generalize our random text generator code to make it more powerful
- 3:24Using our random text generator script to create a virtual Twister spinner
- 4:12Wrapping our people parser in a function, reviewing the code and identifying improvements
- 7:38Reviewing our generalized parsing function, part 1
- 5:57Reviewing our generalized parsing function, part 2
- 6:32Exploring our generalized table rendering function
- 2:50Re-using our table rendering function and evaluating our changes
- 22:34Troubleshooting errors and using operators
- 2:32Accidentally assigning a variable instead of comparing it
- 2:54Troubleshooting a missing closing bracket
- 1:34Troubleshooting a missing opening bracket
- 2:11Troubleshooting a missing parenthesis
- 1:20Troubleshooting the "Wrong parameter count" error
- 3:32How to use assignment and string operators
- 2:40How to use comparison operators
- 1:47How to use arithmetic and incrementing operators
- 2:03How to use logical operators
- 2:01How to use array operators
- 101:13Working With Forms in PHP
- 4:07The lifecycle of a form and chapter overview
- 6:06How to process a simple form with PHP
- 1:40A quick overview of the next three form examples
- 4:10How to use a hidden input to distinguish multiple forms on one page and how $_REQUEST works
- 2:00The HTML structure of a simple contact form
- 2:06How to pre-fill form inputs, and seeing our rendered forms
- 4:00How to use a switch statement and the $_POST variable
- 6:10How to process a contact form and send a plain text mail with PHP
- 3:42How to keep data in an input after a form is submitted, and a quick review
- 9:17How to run our examples in a remote development environment with Pantheon
- 8:04How to run our examples in a remote development environment with WebEnabled
- 5:19How to use a ternary operator and our search form in action
- 3:11Stepping through our search form code the first time the form is generated
- 8:50Stepping through our search form code after a search is submitted
- 3:33Demoing our random text generator with a form for user-set tokens
- 3:39Stepping through our random text generator form code the first time it's generated
- 6:44Stepping through our random text generator form code after it's been submitted
- 5:10How to use file comparison tools to see differences between files
- 1:48Demoing our random text form with loop-generated infinite inputs
- 5:56Stepping through our infinite randomness code the first time it's loaded
- 2:09Stepping through our infinite randomness code after submitting the "number of inputs" form
- 3:32Stepping through our infinite randomness code after submitting the "random generation" form
- 90:19Working With Sessions in PHP
- 4:11How use to sessions and the $_SESSION variable to store user information
- 1:18Demoing our log in form
- 3:00How to create a log in form
- 4:34How to handle log in errors when submitting an invalid username and password
- 3:05How to log a user in after submitting a valid username and password
- 2:12How to log out a user and pass variables through the URL
- 3:59A demo of our text adventure game
- 13:12Stepping through our code the first time the game is loaded, and how global variables work
- 9:37Entering a command in our text adventure game, and using the eval() function
- 6:12Stepping through our game code as we move south and north
- 8:55Stepping through our game code as we pick up and item, use it, then reset our game
- 4:38How an index.php page works, and a quick demo of our refactored game
- 2:20The pros and cons of using .inc files, and a review of our new file structure
- 3:02The benefits of creating a function library and reviewing our index and function files
- 6:12Reviewing the updates we made to avoid using global variables
- 6:01Continuing our review, the benefits of generalizing code and caching data
- 4:22Wrapping up our review of changes in our refactored text adventure
- 3:29Creating a render function for our game as a final touch
- 65:08Working With the (MySQL) Database
- 4:22The benefits of using a database (MySQL)
- 4:42What databases and tables are, plus a quick tour of PHPMyAdmin
- 5:06What SQL is and how to write a simple SELECT query
- 2:45How to filter SQL query results with LIKE and wildcards
- 4:47How to create your first database and table
- 4:04How to change column types using PHPMyAdmin and adding our final entry
- 5:40How to use AND and LIKE with two wildcards in a query
- 6:03How to connect to a MySQL database with PHP
- 3:11How to run a MySQL database query in PHP
- 2:44How to use ORDER BY to sort query results and a couple other query examples
- 2:23How to move our database connect script to a commonly included file
- 3:36How to add new fields to a table and a warning about modifying existing tables
- 2:46Populating our new people table columns and demoing our login form
- 2:36Comparing our array-based login form to our database-based version
- 1:17How to turn off magic quotes for a more realistic server enviornment
- 4:38What an SQL injection attack is and how to create one
- 2:51How to protect against an SQL injection attack
- 1:37The two types of attack, and brief explanation of defense strategy
- 69:02Working with CRUD functionality and our database
- 2:27What CRUD is (Create, Read, Update, Delete) and how to backup a database in PHPMyAdmin
- 4:23How to import from PHPMyAdmin and protect against Cross Site Request Forgeries (CSRF)
- 3:21How to display a list of database data in an HTML table using PHP
- 2:34How to create a "delete" HTML link that deletes a database record
- 2:36How an INSERT statement is structured, and a demo of our insert form
- 3:05Reviewing the differences after added the insert form to our script
- 4:59How to generate an INSERT statement using a loop, and a review of our workflow
- 2:55Why to validate forms, and a demo of validating numbers, usernames and empty inputs
- 3:32Comparing the validation changes made in our CRUD script
- 5:46How to use looping in validation and validate empty and numeric inputs
- 3:44How to validate alphanumeric inputs and unique usernames
- 2:14Demo of our update form script
- 1:17How to structure an UPDATE statement and the importance of not forgetting WHERE
- 5:54Reviewing changes where we added the ability to update a record
- 4:19How to use the same form to both create and update records
- 6:02Walking through our add and edit form code as it is processed
- 2:13Ways that our CRUD script could be refactored and improved
- 6:09Comparing our refactored changes to our previous CRUD script
- 1:32A quick review of our CRUD form improvements
- 124:31How to Build Your Own Content Management System and Understand Drupal Better
- 2:41Additional ways that we could use databases and our next big example
- 3:13Reviewing the visual structure of our static site
- 1:07Reviewing the folder and file structure of our static site
- 5:35Comparing the HTML structure of our home and about pages
- 3:23How to create a header template file
- 3:53Creating our footer and applying our templates to the home page
- 2:07Applying our header and footer to our other pages
- 1:52Reviewing our product page and identifying repetition that can be turned into a function
- 4:03How to render our products with a function to reduce HTML repetition
- 3:01When to use unique identifiers (IDs) and what a universally unique ID is (UUID)
- 5:00How to use a central product array for both of our product listings
- 1:54Applying our product rendering function to the product page
- 1:27The benefits of routing every page request through a single file with mod_rewrite
- 2:24How a .htaccess file works and how to set one up
- 5:41How to route all URLs through a single file (the Front Controller pattern)
- 3:29How to use the URL query string to trigger an include
- 1:32How to use the heredoc syntax to avoid escaping multiple quotes
- 2:06Why to use a full page template file instead of a header and footer
- 2:50A quick summary of our changes and a review of our other include files
- 1:27Why it's useful to have configurable settings for the end user and to reuse on other sites
- 6:04Walking through changes after adding configurable settings
- 2:14Why it's better to use a function for settings instead of direct variables
- 3:24What still needs to happen to allow end users to manipulate data on our site
- 3:19Creating the database and users table for our next steps
- 1:38Demo of our CMS login form
- 5:42Adding our database connect script, notices function and login links
- 3:52How our login and logout features work
- 2:18Demo of our new edit, delete and add user features
- 0:48Reviewing changes in our login form
- 6:53What happens in our updated CRUD code when we submit a user edit form
- 5:52What happens in our updated CRUD code when we add a user
- 5:24The problem with using relative or absolute paths in subfolders
- 4:23Using a URL function to route all requests to the right location regardless of subfolder
- 3:28Creating our products database table and populating it
- 2:41Discussing the similiarties that will exist between our product and user administration pages
- 1:04Demo of our updated product CRUD script
- 4:17Comparing the code in our user and product CRUD scripts
- 2:25Reviewing changes in our product rendering code, and how the WHERE IN SQL syntax works
- 76:59Generalizing Functionality and Object Oriented Programming Primer
- 1:37Why generalizing CRUD functionality makes so much sense
- 1:35Setting up the next steps and a demo of our generalized CRUD script
- 5:30How to distill CRUD configuration options into an array
- 1:25Overview of the functions in our generalized CRUD script
- 6:09How to create a generalized record listing function
- 6:51How to build a generalized CRUD edit and add form function
- 5:39How to build a generalized CRUD form validation function
- 3:46How to create a generalized CRUD form processing script
- 1:54Summary of what we've accomplished, and a few challenges
- 2:00How to set up a database table to store page data
- 5:26Demoing our page administration tools and adding our adding our first pages
- 6:00How to load pages from both files and the database
- 3:29How to convert file-based pages to database-based pages, and deciding which to convert
- 1:16How this split file and database structure relates to Drupal
- 3:41What we've accomplished with our CMS, compared to other CMS's like Drupal
- 3:07Challenge your new PHP skills with these CMS enhancements
- 1:20Why there's no need to be scared of OOP (Object Oriented Programming)
- 2:30Demonstration of our new object oriented CRUD code
- 2:38The weaknesses of function-based coding, and what objects are in OOP
- 3:57How classes, methods, properties and constructors work
- 3:29How instantiation works, and comparing our old render function to our new OOP one
- 1:39How to use properties in a class
- 1:35What extending a class means
- 0:26Congratulations on finishing PHP Programming Basics