PClib demo site

<?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/basicform.tpl');

//if submitted, show values
if ($form->submitted) {
  print 
"You submitted following values:<br>";
  
var_export($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;

?>

Elapsed time: 9.88 ms