<?php
/**
* PHP Controller
*
* PHP versions 5
*
* LICENSE: This source file is subject to version 3.0 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_0.txt. If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to hide@address.com so we can mail you a copy immediately.
*
*
* @category Example
* @package PHP-Controller
* @author Eddie Tejeda <hide@address.com>
* @copyright 2005 Visudo LLC
* @version 0.3
*/
class Forum{
var $database;
/**
* Contructor does nothing here
*
*/
function Forum(){
$this->database= $_SESSION['database'];
}
function messages(){
return $this->database->query("SELECT * FROM Messages");
}
/**
* Action Method that adds new user to user_table, gets information through POST[]
* forwards user back to Allusers
* @return bool auth was succesful
*/
function addMessage($url, $get, $post, $cookie){
}
/**
* Action Method that adds new user to user_table, gets information through POST[]
* forwards user back to Allusers
* @return bool auth was succesful
*/
function addMessageAction(){
$firstname = strip_tags($_POST['firstname']);
$message = strip_tags($_POST['message']);
$this->database->query("INSERT INTO Messages (firstname, message) VALUES ('$firstname', '$message')");
//to debug, i stopped the page from forwarding
//print_r($this->database->getDebugInfo());
//die();
}
}
?>