Difference between revisions of "Design Document PHP Coding Details"

From BOARD18 Project WIKI
Jump to navigation Jump to search
(→‎createGame.php: initial content)
(→‎config.php: initial content)
Line 53: Line 53:
===configMail.php===
===configMail.php===
===config.php===
===config.php===
config.php is included at the start of all pages and php routines
that access the board18 database.  Modify DB_HOST and if necessary
DB_DATABASE to contain the correct database host and name. You can
also change the database user ID and password here.
  define('DB_HOST', 'localhost');
  define('DB_DATABASE', 'board18');
  define('DB_USER', 'board18');
  define('DB_PASSWORD', 'board18');
===sendEmail.php===
===sendEmail.php===
===makeTables.php===
===makeTables.php===

Revision as of 16:39, 15 December 2013

Design Document edit


This page has details of all of the PHP files that are described in the Server Side Overview. The origional description for each file has been taken from the comments at the top of the file in question. While creating this page I will also be bringing these comments in line with these Standards.

AJAX Called Programs

An oveview discussion of these programs is available here.

changePlayers.php

changePlayers.php is the server side code for the AJAX changePlayers call. This program adds and/or removes players from existing game sessions.

Inputs:

  mode - A string with a value of '1', '2' or '3'.
         1 - Remove player with login ID in prem.
         2 - Add player with login ID in padd.
         3 - Take both of the above actions.
  game - game_id of current game.
  prem - Login ID of the player to be removed from the game.
  padd - Login ID of the player to be added to the game.  

Output is an echo return status of either "success", "fail" or "dupadd".

createGame.php

config.php is included at the start of all pages and php routines that access the board18 database. Modify DB_HOST and if necessary DB_DATABASE to contain the correct database host and name. You can also change the database user ID and password here.

 define('DB_HOST', 'localhost');
 define('DB_DATABASE', 'board18');
 define('DB_USER', 'board18');
 define('DB_PASSWORD', 'board18');

emailPlayerAdd.php

emailPlayerRem.php

emailPlayerID.php

emailPassword.php

forcePasswd.php

gameBox.php

gameSession.php

logout.php

myGameList.php

newUser.php

updateGame.php

updateUser.php

validateUser.php

Include Modules

An oveview discussion of these modules is available here.

auth.php

auth.php is included at the start of all password protected pages and all password protected PHP programs called via AJAX.
It starts a php session and then checks to see that the player is logged in and has been active sometime in the last 30 minutes.

configMail.php

config.php

config.php is included at the start of all pages and php routines that access the board18 database. Modify DB_HOST and if necessary DB_DATABASE to contain the correct database host and name. You can also change the database user ID and password here.

 define('DB_HOST', 'localhost');
 define('DB_DATABASE', 'board18');
 define('DB_USER', 'board18');
 define('DB_PASSWORD', 'board18');

sendEmail.php

makeTables.php


This page is a stub.
The BOARD18 Project will soon be expanding it.