各位高手,我想把location取得值,插入DB里。
想问的是,除了从text box表示的参数能插入DB,还有别的办法吗?参考:
<script type="text/javascript">
function getdata(){
if(window.location.search){
/* URLの「?」以降のパラメータを変数nに代入 */
var n=window.location.search.substring(1,window.location.search.length);
/* 在text box表示参数 */
document.form3.elements["getpram"].value=n;
}
}
/* 加载時実行 */
window.onload=getdata;
</script><form name="form3" action="#">
取得参数:<input type="text" name="getpram" size="50" />
</form>
想问的是,除了从text box表示的参数能插入DB,还有别的办法吗?参考:
<script type="text/javascript">
function getdata(){
if(window.location.search){
/* URLの「?」以降のパラメータを変数nに代入 */
var n=window.location.search.substring(1,window.location.search.length);
/* 在text box表示参数 */
document.form3.elements["getpram"].value=n;
}
}
/* 加载時実行 */
window.onload=getdata;
</script><form name="form3" action="#">
取得参数:<input type="text" name="getpram" size="50" />
</form>
从字面理解应该是服务器端的数据库吧那么 window.location 的值不是从服务器端返回的吗?
为什么不在服务器端直接处理呢?
不好意思,我对开发是一知半解,简单的说,就是想把PHP做的HTML上输入的数据,给插入到DB里。
那要在哪里,怎样写呢?
其实是,行追加按键按后,自动追加3行,3行为一组。
想把客户端填写的东西都输入到DB。
可是,那个Table的取值是动态插入的,不太会取值呢。
您说的意思应该是,把Table的输入值直接引用输入到DB吧?*****************************
js 动态的创建tr td 和input然后php可以直接遍历
$_GET
或者$_POST
数组就能取得所有值