Location: PHPKode > projects > RabbitBB - Online Web Storage Project > mywebdrive/PHP_CON/formcontroller.php
<?PHP

$rootpath=$_SERVER['DOCUMENT_ROOT'] . "/";
include_once($rootpath . "common.php");


if (is_array($_GET) && (isset($_GET['action'])))
   doGet($_GET);
elseif (is_array($_POST) && (isset($_POST['action'])))
   doPost($_POST);
else
   exit;

function doGet($request)
{
	global $rootpath, $webappcfg, $rb;

	if ($request['action'] == "submitform")
	{
		$response = array();
		include($webappcfg['APPPATH'] . "/" . "contactform/include.php");
		include($webappcfg['APPPATH'] . "/phpmailer/class.phpmailer.php");
		$request['contactemail'] = $webappcfg['contactemail'];
		$request['parampath'] = $webappcfg['APPPATH'] . "/" . "contactform/contactform.php";
		$bsc = new BSContact();
		$response = $bsc->submitform($request, $response);

		if (isset($response['finished']) && ($response['finished'] == true))
		{
			include($rootpath . "contactus/success.php");
		}
		elseif (isset($response['error']) && ($response['error'] != ""))
		{
			include($rootpath . "contactus/index.php");
		}
	}
	elseif ($request['action'] == "register")
	{
		$response = array();
		include($webappcfg['APPPATH'] . "/" . "register/include.php");
		if (isset($request['step']))
		{
			switch ($request['step'])
			{
				case 1:
					{
						$request['parampath'] = $webappcfg['APPPATH'] . "/" . "register/registerform.php";
						$bsr = new BSRegister();
						$response = $bsr->submit($request, $response);

						echo("<PRE>");
						print_r($response);

						if ($response['finished'] == true)
						{
							// Include Confirm Form
						}
						else
						{
							// Include Org Form
						}
						break;
					}
				case 2:
					{
						break;
					}
				case 3:
					{
						break;
					}
			}
		}
		else
		{
			echo("HACKING ATTEMPT");
		}
	}

}

function doPost($request)
{
	doGet($request);
}

/*

Function to check login

		if (!NSession::check_login())
		{
			//echo("NOLOGIN");
			// Bring to login page;
			header("Location: http://".$webappcfg['httphost']."/");
			return;
		}


*/

?>
Return current item: RabbitBB - Online Web Storage Project