In HTML, you can send data from one page to another using a GET request in a couple of ways:
http://www.example.com/somepage.php?data=1
…or…
<form action='somepage.php' method='get'> <input type='hidden' name='data' value='1' /> <input type='submit' value='Submit'> </form>
With a POST request though, I’ve only seen data being sent through form elements like this:
<form action='somepage.php' method='post'> <input type='hidden' name='data' value='1' /> <input type='submit' value='Submit'> </form>
If I only have one parameter I want to send to another page using POST, is there an easier way than wrapping it in a form?
There are only two ways to POST from a browser – a form, or an Ajax request.