亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

性別按鈕沒被選中

<tr>
				<th>用戶性別</th>
				<td>
				??<!--?<input?type="text"?name="email"?value="<?php?echo?$res['email'];??>"?/>?-->
				??<input?type="radio"?name="sex"?value="1"?<?php?echo?$res['sex']=="男"?"checked='checked'":null;??>?>男
				??<input?type="radio"?name="sex"?value="2"?<?php?echo?$res['sex']=="女"?"checked='checked'":null;??>?>女
				??<input?type="radio"?name="sex"?value="3"?<?php?echo?$res['sex']=="保密"?"checked='checked'":null;??>?>保密
				</td>
			</tr>

http://img1.sycdn.imooc.com//551be30f0001b32109920071.jpg

正在回答

3 回答

還請指教

<?php

require_once '../include.php';

$id=$_REQUEST['id'];

$sql="select id,username,password,email,sex from imooc_user where id='{$id}'";

$row=fetchOne($sql);

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Insert title here</title>

</head>

<body>

<h3>編輯用戶</h3>

<form action="doAdminAction.php?act=editUser&id=<?php echo $id;?>" method="post" enctype="multipart/form-data">

<table width="70%" border="1" cellpadding="5" cellspacing="0" bgcolor="#cccccc">

<tr>

<td align="right">用戶名</td>

<td><input type="text" name="username" placeholder="<?php echo $row['username'];?>"/></td>

</tr>

<tr>

<td align="right">密碼</td>

<td><input type="password" name="password"/></td>

</tr>

<tr>

<td align="right">郵箱</td>

<td><input type="text" name="email" placeholder="<?php echo $row['email'];?>"/></td>


</tr>

<tr>

<td align="right">性別</td>

<td><input type="radio" name="sex" value="1" <?php echo $row['sex']=="男"?"checked='checked'":null;?>/>男

<input type="radio" name="sex" value="2" <?php echo $row['sex']=="女"?"checked='checked'":null;?>/>女

<input type="radio" name="sex" value="3" <?php echo $row['sex']=="保密"?"checked='checked'":null;?>/>保密

</td>

</tr>

<tr>

<td colspan="2"><input type="submit" ?value="編輯用戶"/></td>

</tr>


</table>

</form>

</body>

</html>



0 回復 有任何疑惑可以回復我~

我的有從數據庫讀取數據,為什么還是沒有被選中

0 回復 有任何疑惑可以回復我~

是因為根本沒從數據庫里面查找sex,太不細心了,難怪老在出錯/(ㄒoㄒ)/~~

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消
手把手教你實現電商網站后臺開發
  • 參與學習       117254    人
  • 解答問題       2101    個

手把手教你用PHP搭建電子商務平臺,由淺入深教你搭建電商系統

進入課程

性別按鈕沒被選中

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號