How to pass POST parameters in a URL?

前端 未结 7 437
生来不讨喜
生来不讨喜 2020-12-13 04:12

Basically, I think that I can\'t, but would be very happy to be proven wrong.

I am generating an HTML menu dynamically in PHP, adding one item for each current user,

相关标签:
7条回答
  • 2020-12-13 04:41

    I would like to share my implementation as well. It does require some javascript though.

    <form action="./index.php" id="homePage" method="post" style="display: none;">
    <input type="hidden" name="action" value="homePage" />
    </form>
    <a href="javascript:;" onclick="javascript:
    document.getElementById('homePage').submit()">Home</a>
    

    Nice thing about this, is that contrary to GET requests, it doesn't show the parameters on the URL, which is safer.

    0 讨论(0)
提交回复
热议问题