Is the only way of passing POST parameters in HTML through a form?

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?

Answers


There are only two ways to POST from a browser - a form, or an Ajax request.


Need Your Help

Boost MPL nested lambdas

c++ boost-mpl

I have been trying to get to grips with Boost MPL.

Is there a way to _somehow_ use an enum value to pass a method call as a generic parameter of that method?

c# generics enums

(The question might not make enough sense. It was hard to write it. Feel free to update it if you can make it more clear.)

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.