Scroll To Bottom Mystery Master Build Puzzle Modules Member

Detective

Introduction

This help article (work in progress) explains how to develop a logic puzzle module using PHP and JavaScript. PHP is used to bundle the CSS (style sheets) and HTML needed to display a logic puzzle, while JavaScript is used to create and solve the puzzle. All of your files need to be located somewhere on your computer (like a hard drive or USB drive). I keep all of my development projects in my C:\projects folder. Since I am creating logic puzzles for the Mystery Master website, my project folder is C:\projects\mysterymaster.com. Inside my project folder, I need folders to store images (img), style sheets (css), JavaScript files (js), and common PHP and JavaScript files. You can see a representation of the project folder in the sitemap. Make sure you do the following steps to create the project folder on your computer.

Tip: Right-click on a link to download the file.

Create Project Folder

  1. In File Explorer, create the project folder C:\projects\mysterymaster.com
  2. In project folder, create css folder, and download files referenced in sitemap to this folder
  3. In project folder, create help folder to be populated later.
  4. In project folder, create img folder, and download files referenced in sitemap to this folder
  5. In project folder, create inc folder, and download files referenced in sitemap to this folder
  6. In project folder, create logs folder used by the Logjam.php class

Create Puzzles Folder

  1. In project folder, create puzzles folder, and download "Team Tutor PHP file to this folder
  2. Create puzzles\css folder to be populated later
  3. Create puzzles\html folder, and download "Team Tutor HTML file to this folder
  4. Create puzzles\img folder, and download "Team Tutor image to this folder
  5. Create puzzles\inc folder, and download files referenced in sitemap to this folder
  6. Create puzzles\js folder, then create TeamTutor.js JavaScript file in this folder to be developed later
  7. Create puzzles\js\inc folder, and download files referenced in sitemap to this folder

Install IDE

IDE stands for Integrated Development Environment. There are several IDEs for JavaScript development, but I will explain how to install Visual Studio Code.

  1. In your browser, navigate to the home page for Visual Studio Code
  2. Click the "Download for Windows" link to download the VSCodeUserSetup executable
  3. Run the downloaded executable to install the IDE (I have version 1.38.0)
  4. Run the application
  5. On the Welcome page, install support for JavaScript and PHP
  6. On the Welcome page, click "Open folder..." and select the project folder C:\projects\mysterymaster.com

Install IIS

IIS stands for Internet Information Services. Running your project on IIS allows you to debug before it is deployed.

TODO

Install PHP for IIS

TODO

Note: If you get the error shown below, please read http://help.phpmelody.com/how-to-fix-warning-session_start-function-session-start-opentmpsess_-o_rdwr-failed/ You may need to set session.save_path = in your php.ini file.

PHP Warning:  session_start(): open(C:\WINDOWS\TEMP\sess_h36970rsiij45m5ia9rudvuujq, O_RDWR) failed: Permission denied (13) in C:\projects\mysterymaster.com\inc\session.php on line 9
PHP Warning:  session_start(): Failed to read session data: files (path: ) in C:\projects\mysterymaster.com\inc\session.php on line 9