📖 Creating a PHP website to host our games
In this chapter, we work on the PHP part.
We do our PHP exercise in c9.io.
- Go to c9.io
- Create an account if you don’t have one.
- Create new public workspace, give it a name, and choose PHP.
- Then we are now ready to code the PHP.
- To test the PHP, click on the "Run Application".
Ultimately we want to build a website that host all the HTML5 games we have made during the course. But we’ll build the PHP website step-by-step.
Here is the milestones to build our HTML5 game website.
- Create a single page website that show the title and banner of the games we have made. Clicking on the title may link to the Codepen of the game.
- Create a 2 pages hierarchy for our website:
- The home page is the index of our games.
- Clicking on any game goes to the game page. Here is how the game page works:
- The page gets the title and Codepen URL from the query string. (e.g. game.php?title=ABC&url=https://codepen.io/makzan/blahblahblah)
- The page shows the game title and a link to go back to home page.
- The page uses iframe to embed the Codepen-written HTML5 games into the page.
- Database to create and store game.
- HTTP auth.
- Database and $_session PHP auth.