Author Topic: Forms with vlibTemplate  (Read 1568 times)

0 Members and 1 Guest are viewing this topic.

Offline ClausVB

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
    • Homepage: clausvb.de
Forms with vlibTemplate
on: Fri, 30. March 2007 - 20:34:03
Normal form: http://lamp.clausvb.de/vlib_examples/form.php
Forms with vlibTemplate: http://lamp.clausvb.de/vlib_examples/form_tmpl.php

deutsche Dokumentation: Formulare mit vlibTemplate

Code: [Select]
<?php
    
require_once vlib/vlibTemplate.php;

    
$tmpl = new vlibTemplate(tmpl/form_tmpl.htm);

    
$tmpl->setVar(input$_POST[input]);

    
$tmpl->pparse();
?>

Code: [Select]
<body>

<tmpl_if name=input op=<> value=>
    <p>You typed <b>{tmpl_var name=input}</b>.</p>
<tmpl_else>
    <form action="form_tmpl.php" method="post">
        <input name="input">
        <input type="submit">
    </form>
</tmpl_if>

</body>
Last Edit: Fri, 30. March 2007 - 21:05:06 by ClausVB