[摘要]",numkh)+1)); //从 khstr串中取出与kh_id对应的地址字段的值。 frm.address.value=addr; //将取出的值赋给当前录...
",numkh)+1)); //从 khstr串中取出与kh_id对应的地址字段的值。
frm.address.value=addr; //将取出的值赋给当前录入页面上的字段变量address。
}
</script>
3.在html中将二者结合起来,互为所用
$khinfo="select kh_id,address from kh where co_id=$s_coid and type='g' order by kh_id";
//将取供货商信息的sql语句放到变量$khinfo中。
$k=khqk_tq($khinfo); //调用php函数,并将返回的字符串值放到变量$k中。
<meta name="generator" content="microsoft developer studio">
<meta http-equiv="content-type" content="text/html; charset=gb_2312-80">
<title>订货合同管理</title>
</head>
<body style="background-color: ivory">
<form name=frmplanfill method=post action="dhht_crt.php">
<table align=center border=1 cellpadding=0 cellspacing=0 width="90%" style="font-size: 10pt">
<tr>
<td>合同编号</td><td><input name=htbh size=15></td>
<td>合同概述</td><td colspan=5><input name=htgs size=53></td>
</tr>
<tr>
<td>供货厂商</td>
<td><select name="kh_id" onchange="khxz_onclick()"> //当每次改变所选供货商时,触发上述javascript函数。
<?prt_sele("select convert(int,kh_id),name from kh where co_id=$s_coid and type='g'",0,1)?></select></td> //将符合条件的所有供货商名称放到下拉列表框中供用户选择。其中prt_sele是自定义的 php函数。
<td>地 址</td>
<td colspan=3><input type=text name=address size=34 ></td> //触发javascript函数的结果是使得adrress变量获得值并显示到页面上。
以上代码的系统环境是:linux操作系统、sybase数据库、web server为apache、php4程序界面。以上将php和javascript相结合的程序开发思想已成功地运用到我们开发的多个动态web页面中。
关键词:php录入页面中动态从数据库中提取数据的完成