<?php
require_once('common.php');

$image = get_param('image');
$name = get_param('name');
$isSubmit = get_param('submit');
if ($isSubmit) {
$submiturl = REST_URL."?method=HelloWorld.binaryTest";
$queries = array(
'image'=>$image,
'name'=>$name);

$res = simplexml_load_file_with_post($submiturl, $queries);
if ($res->status == 0) {
header("Location: xxxx". "?".htmlspecialchars( SID ));
exit;
}
}


require_once('setup.php');
$smarty = new Smarty_Cgm();
$smarty->assign('image', $image);
$smarty->assign('name', $name);
if ($res->status != 0) $smarty->assign('errormsg', $res->message);

$smarty->display('XXXXX.tpl');

?>