<?
class form_builder {
//form acılır//
function formac($name,$method,$action){
echo "<form name=\"$name\" method=\"$method \" action=\"$action\">\n";
}
//ortak özellikleri olan form alanları türlerine göre sıralanır
function formfield($name,$type,$value,$size,$maxlength,$class,$metin){
if ($type == "checkbox"){
echo "<input name=\"$name\" type=\"checkbox\" value=\"$value\">".$metin."<br>\n";
}else if ($type == "radio") {
echo "<input name=\"$name\" type=\"radio\" value=\"$value\" class=\"$class\">".$metin."<br>\n";
}else if ($type == "submit"){
echo "<input name=\"$name\" type=\"submit\" value=\"$value\" class=\"$class\"><br>\n";
}else if ($type == "reset"){
echo "<input name=\"$name\" type=\"reset\" value=\"$value\" class=\"$class\"><br>\n";
}else if ($type == "file") {
echo "<input name=\"$name\" type=\"file\" size=\"$size\" maxlength=\"$maxlength\"><br>";
}else{
echo "<input name=\"$name\" type=\"$type\" value=\"$value\" size=\"$size\" maxlength=\"$maxlegth\" class=\"$class\"><br>\n";
}
}
//textarea
function textarea($name,$cols,$rows,$value,$class){
echo "<textarea name=\"$name\" cols=\"$cols\" rows=\"$rows\" class=\"$class\">".$value."</textarea><br>\n";
}
///
function listmenu ($type,$name, $option = array () ){
echo "<select".$type."".$name.">\n";
foreach ($option as $value => $metin){
echo "<option value=\"$value\">$metin</option>\n";
}
echo "</select><br>\n";
}
function formkapat(){
echo "</form>\n";
}
}