Example #1
0
function tropoInput()
{
	if(get('test') == 1)
	{
		return new ObjectArray($_GET);
	}

	$jsonInput = file_get_contents("php://input");
	$input = json_decode($jsonInput);
	if(DEBUG_MODE)
	{
		ob_start();
			echo "\n\n\n\n" . date('Y-m-d H:i:s') . ' ' . $_SERVER['REMOTE_ADDR'] . "\n";
			echo '$_GET' . "\n";
			print_r($_GET);
			echo 'request headers' . "\n";
			print_r(apache_request_headers());
			echo '$_FILES' . "\n";
			print_r($_FILES);
			echo 'JSON input' . "\n";
			print_r($input);
			echo "\n";
		filedebug(ob_get_clean());
	}
	return $input;
}
Example #2
0
		ircdebug('Call completed');
		break;
	default: 
		define('SURVEY_MODE', TRUE);
		include('include/question.php');
		break;
}


$json = json_encode(array('tropo'=>$tropo));
header('Content-type: text/plain');

if(get('test'))
{
	echo formatJSON($json);
}
else
{
	echo $json;
}
/*
if(isset($_SESSION))
{	
	filedebug("\n\nSession:\n");
	filedebug($_SESSION);
}
*/

filedebug($json);

?>