To set up a leaderboard using PHP and a database, perform the following steps:
- Copy the PHP project provided to where you will be running your web server:
- Live website hosting:Â Copy the files to the live web folder on your server (often www or htdocs).
- Running on a local machine: At the command line, you can use the Composer script shortcut to run the PHP built-in web server by typing composer serve or php -S localhost:8000 -t public:
Figure 8.1 – Running a web server in a macOS command-line Terminal using the shortcut composer serve
- Open a web browser to your website location:
- Live website hosting:Visit the URL for your hosted domain.
- Running on a local machine: Visit the localhost:8000 URL:
Figure 8.2 – Viewing the high score website home page in a web browser
- Create/reset the database by clicking the last bulleted link: reset database. You should see a page with the message database has been reset, and a link back...