我们可以在邮件功能中使用post方法重定向到另一个页面

While writing php mail function .. i need to put a link in that mail. and also i need to transfer two values to that target page . now i am using .

<a href='http://www.example.com/allow.php?id=$url&cat=$cat'>Click here to accept his request</a> 

When user click this link that page will get those value. But i have to use post method instead of get method . to prevent from knowing of ID and CAT.

Is there any chance to use post method in mail. OR how to delete this link from url after load. or how to encrypt this link..

You are unable to POST in an email, the only method to do this is to use a unique token. This can be, if required, expired once clicked which is used with things such as validating your email address. The unique token can the be linked via a database to link the token to the url and the id which you do not wish the user to see.

You cannot use POST method with a link, but the email sent may contain a whole HTML form, and with that you can use the POST method.
The disadvantage is that not every mail client will display correctly such an email.

No you cannot send a post request from a link in an email. However, you can achieve your goal of not disclosing the variables to the client in a number of ways.

One way would be to have a databse table such as:

request_id | user_id | category
1            73        books

Where by you add a record when a user generates a request, and send the request_id in the email to the receiving user. Then you would look up the request_id and grab the user_id and category.

As mentioned by another user, you could also record when the request had been accepted/declined, set an expiry etc.

Another simpler way would be to use some 2 way encryption on the values, so the email contains the encrypted versions. Perhaps less secure, and less extendable, but probably quicker to set up.