<form name="form" method="post" action="">
<table width="400px" border="1" cellpadding="0" cellspacing="1" bgcolor="#CCFF66">
<tr align="center">
<td width="98" height="120">添加投票选项:</td>
<td width="223" height="120">
<p>
<textarea name="content" id="content" cols="30" rows="5">
</textarea>
<br>
<span class="style1">
注意每个选项用,分割:
</span>
</p>
</td>
<td width="61" height="120">
<input type="Submit" name="Submit" value="提交">
</td>
</tr>
</table>
</form>
<?php
header("Content-Type: text/html; charset=utf-8");
echo $content,"<br>";
if ($_POST[Submit]!="") {
$data=explode(",", $content);
while (list($name,$value)=each($data)) {
echo '<input type="checkbox" name="checkbox" value="checkbox">';
echo $value;
}
}
?>
PHP数组例子: 定义添加投票表单
最新推荐文章于 2021-04-04 00:03:14 发布