
$getid = $_GET['id']
$getxb = $_POST['xb']
……
mysql_query("update yh set xb='$getxb',bj='$getxh,…… where id='$getid'")
?>
这样就可以修改了。其中省略的都是重复的内容,自己改吧。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
<!--
var i = 0
function form( textobj, selectobj, divobj ) { //增加元素
var newHtml = document.createElement('div')
newHtml.id = divobj + i
newHtml.innerHTML = '<input type="text" name="' + textobj + '" \/><select name="' + selectobj + '"><option>请选择<\/option><\/select><a href="javascript:" onclick="del(\'' + ( divobj + i ) + '\')">删除<\/a>'
document.getElementById(divobj).appendChild( newHtml )
i++
}
function del( objs ) { //删除元素
var object = document.getElementById( objs )
object.parentNode.removeChild( object )
}
//-->
</script>
<style>
div{position:relativez-index:0 margin:10px auto}
a{color:#03F text-decoration:none}
</style>
</head>
<body>
<div id="ins">
<input type="text" name="baiyi" />
<select name="zhuli">
<option>请选择</option>
</select>
</div>
<a href="javascript:" onclick="form('baiyi[]', 'zhuli[]', 'ins')">增加</a>
</body>
</html>
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)