首页 > PHP

php录入页面中动态从数据库中提取数据的实现

时间:2009-05-11 07:32:26  作者:chinaitlab  我要投稿
Linux初探欢迎您的投稿,投放方法请点击这里查看,我们会定期赠送精美小礼品给优秀的投稿作者。海纳百川 取则行远!LinuxGoo欢迎您的到来。
摘要:用php制作动态web页面时,在提交服务器之前,让php根据用户在当前页面上录入的某字段的值立即从数据库中取出相关的其它字段的值并显示到当前页面上,是php程序......


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录入页面中动态从数据库中提取数据的实现,请注明来自LinuxGoo.com,其版权归原作者所有。请广大网友留言时遵纪守法,使用文明用语。如果您在应用中有什么问题,请在下面留言,我们会尽快解答。
来顶一下
近回首页
返回首页
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
相关文章
栏目热门