<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無標(biāo)題文檔</title></head><body><?phpif(isset($_POST['action']) && $_POST['action']=='submitted'){?? ?echo "<pre>";?? ?print_r($_POST);?? ?echo '<a href="'. $_SERVER['PHP_SELF'] .'">返回重填</a>';?? ?echo "</pre>";}else{?><form name="form1" method="post" action="<?php? echo $_SERVER['PHP_SELF'];?>"><table width="500" align="center" border="1" rules="all" bordercolor="#ccc" cellpadding="5"> ??? ?<tr>?? ??? ?<td width="100" align="center">用戶名</td>?? ??? ?<td><input type="text" name="username"/></td>?? ?</tr>?? ?<tr>?? ??? ?<td width="100" align="center">密碼</td>?? ??? ?<td><input type="password" name="userpwd"/></td>?? ?</tr>?? ?<tr>?? ??? ?<td width="100" align="center">住址</td>?? ??? ?<td>?? ??? ??? ?<select name="city">?? ??? ??? ??? ?<option value="北京市 " selected="selected">北京市 </option>?? ??? ??? ??? ?<option value="天津市">天津市</option>?? ??? ??? ??? ?<option value="上海市">上海市</option>?? ??? ??? ??? ?<option value="山西省">山西省</option>?? ??? ??? ?</select>?? ??? ?</td>?? ?</tr>?? ?<tr>?? ??? ?<td width="100" align="center">性別</td>?? ??? ?<td>?? ??? ??? ?<input type="radio" name="sex" value="男" selected="selected" />男?? ??? ??? ?<input type="radio" name="sex" value="女"? />女?? ??? ?</td>?? ?</tr>?? ?<tr>?? ??? ?<td width="100" align="center">愛好</td>?? ??? ?<td>?? ??? ??? ?<input type="checkbox" name="like" value="運動" />運動?? ??? ??? ?<input type="checkbox" name="like" value="音樂" />音樂?? ??? ??? ?<input type="checkbox" name="like" value="讀書" />讀書?? ??? ??? ?<input type="checkbox" name="like" value="游戲" />游戲?? ??? ??? ?<input type="checkbox" name="like" value="美食" />美食?? ??? ??? ?<input type="checkbox" name="like" value="逛街" />逛街?? ??? ?</td>?? ?</tr>?? ?<tr>?? ??? ?<td width="100" align="center">自我簡介</td>?? ??? ?<td>?? ??? ??? ?<textarea name="introduce" cols="40" rows="15">?? ??? ??? ?</textarea>?? ??? ?</td>?? ?</tr>?? ?<tr>?? ??? ?<td><input type="submit" value="提交表單" /></td>?? ??? ?<td><input type="reset" value="重新填寫"/></td>?? ?</tr>?? ?<input type="hidden" name="action" value="submitted"/></table></form><?php } ?></body></html>
php提交表單出錯,不能接收到復(fù)選框的數(shù)據(jù)
shiqingqing11
2015-07-13 17:51:33