am using href link, so there is no chance to use post method, now i need to hide the href url, because am passing a value through it, and taking the value from url in inner page, like example
<button onClick="location.href = 'sbsm.php?val=400'">Pay Now</button>
<button onClick="location.href = 'sbsm.php?val=600'">Pay Now</button>
now the problem is a user can change the value 400(package1), 600(package2) according to his choice in the URL bar, i want to stop this. How do i prevent this. any suggestion??
thanks to all........its working now.
You need to add server-side code in sbsm.php
that returns an error if the user requests an item that he shouldn't have access to.
In other words, sbsm.php?val=700
should return an error unless the current user actually has permission to see that.
if you are using Apache server try this: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
If you want to use POST method you can create an html form with action method POST, and a hidden input.
Then write a small function in javascript that updates that field and submits the form. You can trigger this function via the onClick event.