<?php
/* 
 * Sample request to EMS 
 */
include_once('ems_functions.inc.php');

session_start();
$MsgId=EMS_NewMsgId();
$ret = EMS_Initiate(array('MsgId' => $MsgId, 'ReturnUrl' => $ems_cfg['ReturnUrl'].'?PHPSESSID='.session_id()));
if ($ret['ErrorMsg'] || !$ret['RedirectURL']) die($ret['ErrorMsg']);
$_SESSION['emsReq']=$ret;
if (!headers_sent()) header("Location:".$ret['RedirectURL']); else echo "<META HTTP-EQUIV=Refresh CONTENT=\"1; URL=".$ret['RedirectURL']."\">";
unset($_SESSION['emsReq']['RedirectURL']);
?>
