3 回答

TA貢獻(xiàn)1155條經(jīng)驗(yàn) 獲得超0個(gè)贊
內(nèi)置$_get函數(shù)用于以方法=“get”的形式收集值。
<form method="get" action="blah.php"> <input name="test"></input></form>
<script type="text/javascript" charset="utf-8"> var test = "tester"; // find the 'test' input element and set its value to the above variable document.getElementByID("test").value = test;</script>... elsewhere on your page ...<form method="get" action="blah.php"> <input id="test" name="test" visibility="hidden"></input> <input type="submit" value="Click me!"></input></form>

TA貢獻(xiàn)1801條經(jīng)驗(yàn) 獲得超8個(gè)贊
<?php $test = "tester";?><script type="text/javascript" charset="utf-8"> var test = "<?php echo $test?>";</script><?php echo $test;?>
添加回答
舉報(bào)