PHP自动生成表单代码分享
发布时间:2020-12-12 20:56:45 所属栏目:PHP教程 来源:网络整理
导读:Form.php action=$action; $this->method=$method; } function form_start(){ $text=" action}" method="{$this->method}""; if($this->class!==""){ $text.=" class="{$this->class}""; } if ($this->enctype!=="") { $text.=" enctype="{$this->enct
Form.php action=$action;
$this->method=$method;
}
function form_start(){
$text="n";
}
return $text;
}
//文本框函数
function form_text($name,$id,$label_name,$label_for,$value=""){
$text="form_label($label_name,$label_for);
$form_item=$this->form_item($label,$text);
return $form_item;
}
//密码框函数
function form_passwd($name,$value=""){
$text="form_label($label_name,$text);
return $form_item;
}
//隐藏域函数
function form_hidden($name,$value=""){
$text="form_label($label_name,$text);
return $form_item;
}
//文件域函数
function form_file($name,$size=""){
$text="form_label($label_name,$text);
return $form_item;
}
//复选框函数
function form_checkbox($name,$label=array(),$label_for=""){
$i=0;
$text=array();
foreach ($label as $id=>$value){
$text[$i]="";
$text[$i].=" |