PHP 处理表单函数(options,radios,checkboxs)
上一篇 / 下一篇 2007-09-15 17:42:35 / 个人分类:PHP
查看( 94 ) /
评论( 6 )
TAG:
-
特蓝克斯
发布于2007-09-15 17:39:58
-
examples Options 应用
QUOTE:
<?php
/*
* @copyright Copyright (c) 2007 ASEN (bbs.54php.com)
* @author 特蓝克斯
* @package Function
* @date 2007-09-11
* @return Array
* @Notes 处理表单 Options 表单控件
*/
include_once "helpers_forms.php";
$arr_getoptions = array(
// 'key' => 'value',
'54_name' => "54master",
'54_title' => "网络编程",
'54_group' => "本版讨论群: 19870468"
);
$option = getOptions($arr_getoptions);
$option1 = getOptions($arr_getoptions, '', '网络编程');
$option2 = getOptions($arr_getoptions, "54_title");
$option3 = getOptions($arr_getoptions, "54_title", '',true);
$option4 = getOptions($arr_getoptions, '', '', '', '54_title');
?>
添加调用:
<select name="getoption">
<?=$option?>
</select>
<Br>
<textarea style="width:500;height:120">
<select name="getoption">
<?=$option?>
</select>
</textarea>
<br><br>
除VALUE值为"网络编程"的全部调用:
<select name="getoption1">
<?=$option1?>
</select>
<Br>
<textarea style="width:500;height:120">
<select name="getoption1">
<?=$option1?>
</select>
</textarea>
<br><br>
修改时调用:
<select name="getoption2">
<?=$option2?>
</select>
<Br>
<textarea style="width:500;height:120">
<select name="getoption2">
<?=$option2?>
</select>
</textarea>
<br><br>
value值和title值相等时 :
<select name="getoption3">
<?=$option3?>
</select>
<Br>
<textarea style="width:500;height:120">
<select name="getoption3">
<?=$option3?>
</select>
</textarea>
<br><br>
除KEY值为"54_title"全部调用:
<select name="getoption4">
<?=$option4?>
</select>
<Br>
<textarea style="width:500;height:120">
<select name="网络编程">
<?=$option4?>
</select>
</textarea>
-
特蓝克斯
发布于2007-09-15 17:40:41
-
examples Radio 应用
QUOTE:
<?php
/*
* @copyright Copyright (c) 2007 ASEN (bbs.54php.com)
* @author 特蓝克斯
* @package Function
* @date 2007-09-11
* @return Array
* @Notes 处理表单 Radio 表单控件
*/
include_once "helpers_forms.php";
$arr_radio = array(
// 'key' => 'value',
'54_name' => "54master",
'54_title' => "网络编程",
'54_group' => "本版讨论群: 19870468"
);
$radio = getRadios($arr_radio);
$radio1 = getRadios($arr_radio,'radio1','no');
$radio2 = getRadios($arr_radio, 'radio2', 'no', '54_group');
$radio3 = getRadios($arr_radio, 'radio3', '', '' ,'网络编程');
$radio4 = getRadios($arr_radio, 'radio4', '', '' , '', '', '', '', '' ,'54_title');
?>
默认(选中第一个"radio"):
<?=$radio?><Br>
<textarea style="width:500;height:120">
<?=$radio?>
</textarea>
<Br><Br>
默认(选中补选任何一个"radio"):
<?=$radio1?><Br>
<textarea style="width:500;height:120">
<?=$radio1?>
</textarea>
<Br><Br>
修改:
<?=$radio2?><Br>
<textarea style="width:500;height:120">
<?=$radio2?>
</textarea>
<Br><Br>
除VALUE值为"网络编程"的全部调用:
<?=$radio3?><Br>
<textarea style="width:500;height:120">
<?=$radio3?>
</textarea>
<br><br>
除KEY值为"54_title"全部调用:
<?=$radio4?><Br>
<textarea style="width:500;height:120">
<?=$radio4?>
</textarea>
-
特蓝克斯
发布于2007-09-15 17:41:23
-
examples Checkbox应用
QUOTE:
<?php
/*
* @copyright Copyright (c) 2007 ASEN (bbs.54php.com)
* @author 特蓝克斯
* @package Function
* @date 2007-09-11
* @return Array
* @Notes 处理表单 Checkbox 表单控件
*/
include_once "helpers_forms.php";
$arr_checkBox = array(
// 'key' => 'value',
'54_name' => "54master",
'54_title' => "网络编程",
'54_group' => "本版讨论群: 19870468"
);
$arr_values = array(
// 'key' => 'value',
'54_title' => "网络编程",
'54_group' => "本版讨论群: 19870468"
);
$Checkbox = getCheckboxs($arr_checkBox);
$Checkbox1 = getCheckboxs($arr_checkBox, 'checkbox1', 'no');
$Checkbox2 = getCheckboxs($arr_checkBox, 'checkbox2', 'no' , $arr_values);
$Checkbox3 = getCheckboxs($arr_checkBox, 'checkbox3', 'no' ,'54_title');
$Checkbox4 = getCheckboxs($arr_checkBox, 'checkbox4', 'no' , '' , '', '', '', '', '' ,'54_title');
$Checkbox5 = getCheckboxs($arr_checkBox, 'checkbox5', 'no' , '' , '网络编程');
?>
默认(选中第一个"checkbox"):
<?=$Checkbox?><Br>
<textarea style="width:500;height:120">
<?=$Checkbox?>
</textarea>
<Br><br>
一个不选择
<?=$Checkbox1?><Br>
<textarea style="width:500;height:120">
<?=$Checkbox1?>
</textarea>
<Br><br>
通过数组构造选中多个Checkbox
<?=$Checkbox2?><Br>
<textarea style="width:500;height:120">
<?=$Checkbox2?>
</textarea>
<Br><br>
选中其中一个Checkbox元素
<?=$Checkbox3?><Br>
<textarea style="width:500;height:120">
<?=$Checkbox3?>
</textarea>
<Br><br>
除KEY值为"54_title"全部调用:
<?=$Checkbox4?><Br>
<textarea style="width:500;height:120">
<?=$Checkbox4?>
</textarea>
<Br><Br>
除VALUE值为"网络编程"的全部调用:
<?=$Checkbox5?><Br>
<textarea style="width:500;height:120">
<?=$Checkbox5?>
</textarea>
-
十一文
发布于2007-09-15 19:09:41
-
支持你的
呵呵
呵呵
老兄高产
-
绿竹居
发布于2007-09-15 21:46:34
-
好东西。厉害!!!
-
特蓝克斯
发布于2007-09-20 13:05:45
-
用起来还是挺方便的。
