<?php

if (is_object($this))	{
	if ($GLOBALS['HTTP_POST_VARS']['submit'])	{
// Calculate result.
			// Disable cache, because the result must not be cached:
		set_no_cache();
			// Get values:
		$value_1 = $GLOBALS['HTTP_POST_VARS']['value_1'];
		$value_2 = $GLOBALS['HTTP_POST_VARS']['value_2'];
			// Output result:
		$content.='Result is: '.($value_1 + $value_2);
	} else {
// Draw the form:
		$content.='
<form action="'.htmlspecialchars('index.php?id='.$GLOBALS['id'].'&type='.$GLOBALS['type'].'&no_cache=1').'" method="post">
	<input type="text" name="value_1" /> + <input type="text" name="value_2" /> =<br />
	<input type="submit" name="submit" value="Calculate!" />
</form>		
		';
	}
} else die("You MUST include this script as a PHP_SCRIPT cObject.");

?>
