require 'Message.class.php'; error_reporting(E_PARSE); // Checks which $_POST variables are available, and makes a decision based on // the input. Sent from index.html if ($_POST['turn_on'] == "Go!") { if ($_POST['f_name'] && $_POST['l_name']) { $lights = new Lights(); // $lights->addDB($_POST['f_name'], $_POST['l_name']); $lights->lightsOn(); } else { echo "Please enter both first and last name"; } } else { if ($_POST['turn_off'] == "Go!") { if ($_POST['f_name'] && $_POST['l_name']) { $lights = new Lights(); $lights->lightsOff(); } else { echo "Please enter both first and last name"; } } else { if ($_POST['send_message'] == "Submit") { if ($_POST['f_name'] && $_POST['message']) { $message = new Message(); $result = $message->displayMessage($_POST['message']); if ($result) { echo "Sent successfully"; } else { echo "error"; } } else {
<?php include_once "shell.php"; session_start(); //start $_SESSION Authentication::processLogin(); //process login form if submitted if (Authentication::isAuthenticated()) { $nav = new Navigation_Menu(); $nav->processControlMenu(); //process nav if submitted /******TEST CODE*******/ if (!empty($_GET['page'])) { echo Lights::getForm(); } if (!empty($_POST['lights'])) { echo Lights::processPost(); } /******TEST CODE******/ /***Add new User temp code***/ if (isset($_GET['username'])) { Authentication::createNewUser(); } //echo page $nav->displayMenu(); } else { echo Authentication::getForm(); die; } ?> </body> </html>