Chapter 10: Allowing Users to Register Accounts

Now that we’ve done all the hard work of building an extensible framework, it’s time to add some new functionality to the website. We’re going to make it so that users can register accounts on the website with a view to letting them post jokes themselves.

You should already have the table for authors in the database with some data you added via MySQL Workbench. If you don’t, you can execute this query to create the table:

CREATE TABLE author (
  id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(50),
  email VARCHAR(100),
  password VARCHAR(255)
) DEFAULT CHARACTER SET utf8mb4 ENGINE=InnoDB

Don’t worry about adding any records if you don’t have any. We’ll be creating a form that lets us add authors ...

Get PHP & MySQL: Novice to Ninja, 7th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.