我在我的 html 表单中使用以下 javascript 代码捕获了这些值:
<script type="text/javascript">
<!--
function querySt(ji) {
dwnstr = window.location.search.substring(1);
dwnstr = dwnstr.toLowerCase();
gy = dwnstr.split("&");
for (i=0;i<gy.length;i++) {
ft = gy[i].split("=");
if (ft[0] == ji) {
return ft[1];
}
}
return "";
}
cust_lat = querySt("lt");
cust_long = querySt("lg");
document.write(cust_lat);
document.write(cust_long);
-->
</script>
如您所见,我将捕获的变量写入屏幕,因此我知道代码有效。
我需要变量的值cust_lat
并cust_long
放入表单(form1
)上的两个隐藏字段中,替换默认值0
type=hidden name=cust_lat><input style="WIDTH: 79px; HEIGHT: 22px" value="0"
type=hidden name=cust_long><input style="WIDTH: 81px; HEIGHT: 22px" value="0"
index.php
然后使用以下行将结果传递给:
<form method="get" name="form1" action="index.php">
现在,这些字段作为默认值传入 mysql:0
0
我只需要用捕获的值替换这些默认值。
我希望有人能帮帮忙
谢谢你,
雷·沃德