<?php
/* project: Basic form, file: basicform.php */
//Include pclib framework
require 'pclib/pclib.php';
//Create pclib application
$app = new PCApp('demo');
//Initialize form template
$form = new PCForm('tpl/examples/basicform.tpl');
//if submitted, show values
if ($form->submitted) {
print "You submitted following values:<br>";
dump($form->values);
return;
}
//...else populate and show the form
$form->values = array(
'NAME' => 'John',
'SURNAME' => 'Doe',
'SEX' => 'M',
'INTERESTS' => 3,
'COMMENT' => 'Hello there!'
);
//Show the form! Also functions $form->out() and $form->html() can be used.
print $form;
?>