* @copyright 2009 * @license http://www.freebsd.org/copyright/freebsd-license.html Free BSD License */ define('IN_NIFTY', true); define('IN_EVENTS', true); require_once "./../init.php"; /** * Page initialization and session */ $thisPageName = basename(__FILE__); require_once FILE_PATH . '/lang/' . CURRENT_LANGUAGE . '.php'; require_once FILE_PATH . '/lang/' . CURRENT_LANGUAGE . '/events/' . $thisPageName; /** * Page specific logic */ $eventMgr = new eventMgr($mdb2); $val = new validator(); // Grab all expected request variables and validate them. if (isset($_POST['submit'])) { $expected_post = array('e_id' => array('type' => 'integer', 'min' => 1, 'max' => 16777215), 'name' => array('type' => 'string', 'min_length' => 3, 'max_length' => 30), 'email' => array('type' => 'email'), 'attending' => array('type' => 'string', 'min_length' => 2, 'max_length' => 3)); require_once "./../extract_vars.php"; $args = array('e_id' => $e_id, 'name' => $name, 'email' => $email, 'attending' => $attending); try { if ($eventMgr->registerAttendee($args)) { $e_url = $eventMgr->getUrlById($args['e_id']); echo $e_url; if (strlen($e_url) > 0) { header("Location: " . WEB_PATH . "events/?id={$e_url}"); } else { header("Location: " . WEB_PATH . "error.php?id=invalid_event_url"); }
/** * Page initialization and session */ $thisPageName = basename(__FILE__); require_once FILE_PATH . '/lang/' . CURRENT_LANGUAGE . '.php'; require_once FILE_PATH . '/lang/' . CURRENT_LANGUAGE . '/create/' . $thisPageName; /** * Page specific logic */ if (isset($_POST['submit'])) { // Grab all expected request variables and validate them. $expected_post = array('e_name' => array('type' => 'string', 'min_length' => MIN_LENGTH_EVENT_NAME, 'max_length' => MAX_LENGTH_EVENT_NAME), 'e_date_time' => array('type' => 'string', 'min_length' => MIN_LENGTH_EVENT_DATETIME, 'max_length' => MAX_LENGTH_EVENT_DATETIME), 'e_location' => array('type' => 'string', 'min_length' => MIN_LENGTH_EVENT_LOCATION, 'max_length' => MAX_LENGTH_EVENT_LOCATION), 'e_notes' => array('type' => 'string', 'min_length' => MIN_LENGTH_EVENT_NOTES, 'max_length' => MAX_LENGTH_EVENT_NOTES)); $val = new validator(); require "./../extract_vars.php"; $args = array('e_name' => $e_name, 'e_date_time' => $e_date_time, 'e_location' => $e_location, 'e_notes' => $e_notes); $eventMgr = new eventMgr($mdb2); try { if ($e_url = $eventMgr->createEvent($args)) { // Grab event details and send user to the event page header("location:" . WEB_PATH . "events/?id={$e_url}"); } } catch (sqlException $e) { header("location:" . ERROR_PAGE . "?e=1"); } catch (Exception $e) { header("location:" . ERROR_PAGE); } } /** * Language */ /**