我有同样的问题 - 我想通过单击超链接并获取值转到下一页(不使用GET,因为参数存储在URL中)传递参数到另一个页面。
那些不明白你为什么要这么做的答案是你不想让用户看到敏感信息,或者你不想让某人编辑GET。
在淘汰互联网后,它似乎不可能使用POST方法建立一个正常的超链接。
然后我有一个尤里卡时刻! 为什么不只是使用CSS来使提交按钮看起来像一个正常的超链接? ...并将我想要传递的值放入隐藏字段中。
我试了一下,它的工作原理。你可以在这里看到的的exaple http://paulyouthed.com/test/css-button-that-looks-like-hyperlink.php
表单的基本代码:
<form enctype="multipart/form-data" action="page-to-pass-to.php" method="post">
<input type="hidden" name="post-variable-name" value="value-you-want-pass" />
<input type="submit" name="whatever" value="text-to-display" id="hyperlink-style-button"/>
</form>
基本的CSS是:
#hyperlink-style-button{
background:none;
border:0;
color:#666;
text-decoration:underline;
}
#hyperlink-style-button:hover{
background:none;
border:0;
color:#666;
text-decoration:none;
cursor:pointer;
cursor:hand;
}
#hide{visibility:hidden;width:0px;}
我只是写类似的东西,] 1个 – Adirael 2010-05-24 15:44:36