怎么传递变量?
plits 2006-03-27 09:31:17 <?php
function setValues($a, $b){
echo "<script language=javascript>";
echo "document.form1.depart.value='".$a."'";
echo "document.form1.topic.value='".$b."'";
echo "</script>";
}
.....
.....
//最终可以取得
//$depart = "会计部";
//$topic = "重要发文";
?>
<form name="form1" method="post" action="content.php">
<table>
<tr>
<td>
<input type="hidden" name="depart">
<input type="hidden" name="topic">
<a href="content.php" onclick="<?php setValues($depart, $topic); ?>">测试</a>
</td>
</tr>
</table>
</form>
我的本意是:点击不同的链接把相应的值设定后传递给下一个页面。
请问怎么实现啊?