Created
January 4, 2009 03:59
-
-
Save hiredman/43002 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function dd(&$x){ | |
print "<dd>".$x."</dd>"; | |
} | |
function next_button(){ | |
print "<dd class=\"next\"><input class=\"next\" value=\"Next\" type=\"submit\" /></dd>"; | |
} | |
function attribute_printer(&$attrs){ | |
foreach($attrs as $k=>$v){if ($k != "" && "" != $v) { | |
print $k."=\"".$v."\""; | |
} else {}} | |
} | |
function form_open(&$args){ | |
print "<form".attribute_printer($args).">"; | |
} | |
function form_close(){ | |
print "</form> | |
"; | |
} | |
function selectbox(&$attrbs,&$x){ | |
print "<select"; | |
attribute_printer($attrbs) | |
print "> | |
"; | |
foreach($x as $k=>$v){ | |
print "<option value=\"".$value."\">".$value."</option> | |
"; | |
} | |
print "</select> | |
"; | |
} | |
function input_field(&$attrbs,&$box){if ($box) { | |
print "<dd>"; | |
} else {} | |
print "<input "; | |
if (!array_key_exists("type",$attrbs)) { $attrbs['type']="text"; } else {}if (array_key_exists($attrbs['name'],$_POST) && !array_key_exists) { $attrbs['value'] = $_POST[$attrbs['name']]; } else {}attribute_printer($attrbs) | |
print ">"; | |
if ($box) { | |
print "</dd>"; | |
} else {} | |
print " | |
"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment