<?php
+ function form($classes = null, $action = null) {
+ if (is_null($classes)) $classes = array();
+ else if (! is_array($classes)) $classes = explode('/\s+/', $classes);
+ if (! isset($action)) $action = $_SERVER['REQUEST_URI'];
+ echo "<form ";
+ if (count($classes)) printf("class=\"%s\" ", implode(" ", $classes));
+ echo "method=\"POST\" action=\"$action\">\n";
+ }
+
+ function end_form() {
+ echo "</form>\n";
+ }
+
function input($name, $value = null, $type = null) {
echo "<input name=\"$name\"";
if (isset($type)) echo " type=\"$type\"";