the foreach method is not working properly in the smarty template engine. Can you show how it might look using a while loop
// Foreach data in post array saved : add a new input in the redirection form
foreach($_SESSION['POSTDATA'] as $key => $value)
{
    if($key!='ACTION' && $key!='AES_KEYS')
    {
        $smarty->assign('postdata',array('id' => $key, 'name' => $key, 'value'  => $value));
    }
}
$_SESSION['POSTDATA'] = '';