I am new to this forum and I have been learning PHP from this night.
I want to submit a form, but I do not know the difference between:
<form action="page2.php" method="GET">
and
<form action="page2.php" method="POST">
Can anybody help me?
Thank.
Get
Post
HTTP GET , HTTP POST . GET URL-, , . POST . , .
GET, URL- .
GET
www.someemailprovider.com/?login=joe@email.com&password=xxyz
A POST , GET, HTTP-, URL-.
POST
, GET idempotent POST , GET , , POST, , , , GET idempotent, POST - .
, , , GET . GET, , POST. , , , POST , - , .. GET , . , GET , - , .
HTTP-, PHP.
$ _ GET is appended to the end or URL. i.e. http://example.org/?foo=bar Get access to it in PHP with:
$foo = $_GET['foo'];
or $ foo = $ _REQUEST ['foo'];
GET is used for information that you do not mind to see people, and can be manually entered in links and URLs to get results.
$ _ POST is not displayed in your URL and is usually used after submitting the form. Access it in PHP with:
$foo = $_POST['foo'];
Learn more about HTTP requests at http://www.w3schools.com/tags/ref_httpmethods.asp