RE: HTML Quickform passes values in URL
Vignesh M P N <[email protected]> Thu, 14 Dec 2006 14:01:30 -0600
| Newsgroups | gmane.comp.php.pear.general,gmane.comp.php.smarty.general |
|---|---|
| Message-ID | <002d01c71fba$a5cca9a0$48842fd8@vignesh> |
Thanks for your input. I apologize for being unaware of the etiquette.
Please find below the simplified code fragments from associated 3 files.
Also the below snippets will explain what I meant by "fetch/echo".
==================
login.php
==================
$formAuth = new HTML_QuickForm('login', 'POST', $_SERVER['PHP_SELF']);
$formAuth->addElement('text', 'lusername', 'Username:', array('class' =>
'input', 'size' => 32, 'maxlength' => 32));
$formAuth->addElement('password', 'lpasswd', 'Password:', array('class' =>
'input', 'size' => 32, 'maxlength' => 32));
$formAuth->addElement('submit', 'login', 'Log In');
$tpl =& new Smarty;
$tpl->template_dir = './templates';
$tpl->compile_dir = './templates_c';
$renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl, true);
$formAuth->accept($renderer);
// Assign array with form data
$rarray=$renderer->toArray();
$tpl->assign('login', $rarray);
// Capture the array stucture
ob_start();
print_r($rarray);
$tpl->assign('static_array', ob_get_contents());
ob_end_clean();
include "tmpl_princ.php";
display_princ("",array(" "),$tpl->fetch('Login.tpl'));
==================
tmpl_princ.php
==================
<?
function display_princ($conditions,$options,$stringcontent="")
{
?>
echo $stringcontent;
<?
}
?>
==================
Login.tpl
==================
{$form.javascript}
<form {$form.attributes}>
{$form.hidden}
<TABLE height=100% name="TblLogin" id="TblLogin" >
<TR>
<TD class="label">
{$login.lusername.label}
</TD>
<TD>
{$login.lusername.html}
</TD>
</TR>
<TR>
<TD class="label">
{$login.lpasswd.label}
</TD>
<TD>
{$login.lpasswd.html}
</TD>
</TR>
<TR>
<TD colspan=2>
{$login.login.html}
</TD>
</TR>
</TABLE>
Thanks
Vignesh.
-----Original Message-----
From: Alexey Borzov [mailto:[email protected]]
Sent: Thursday, December 14, 2006 1:34 PM
To: Vignesh M P N
Cc: [email protected]
Subject: Re: [PEAR] HTML Quickform passes values in URL
Hi,
Vignesh M P N wrote:
> Please let me know what I am missing here. Sorry I didn't provide any code
> fragments as they are huge.
...and that's precisely the reason you won't get any useful answers. Come to
think of it, you won't get any useful answers if you post "huge" code
fragments,
either.
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php