Method GET y POST
In the previous page we have indicated that data in a form is sent through the method indicated in the attribute METHOD of the tag FORM, the two possible methods are GET and POST.
The difference between these two methods is in the way of sending data to the page, while the GET method sends data using URL, the POST method sends them through the standard entrance STDIO
<!-- PHP Tutorial WebEstilo.com -->
<html>
<head>
<title>PHP Example</title>
</head>
<body>
<H1>Processing forms</H1>
<FORM ACTION="procesa2.phtml" METHOD="GET">
Insert your first name:<INPUT TYPE="text" NAME="name"><BR>
Insert your last name:<INPUT TYPE="text" NAME="last"><BR>
<INPUT TYPE="submit" VALUE="Enviar">
</FORM>
</body>
</html>
<!-- PHP Tutorial WebEstilo.com -->
<html>
<head>
<title>PHP Example</title>
</head>
<body>
<H1>Processing forms</H1>
<FORM ACTION="procesa2.phtml" METHOD="POST">
Insert your first name:<INPUT TYPE="text" NAME="name"><BR>
Insert your last name:<INPUT TYPE="text" NAME="last"><BR>
<INPUT TYPE="submit" VALUE="Enviar">
</FORM>
</body>
</html>
procesa2.phtml
<!-- PHP Tutorial WebEstilo.com -->
<html>
<head>
<title>PHP Example</title>
</head>
<body>
<H1>Processing forms</H1>
Your name by GET: <?php echo $_GET['name']," ",$_GET['last'] ?><br>
Your name by POST: <?php echo $_POST['name']," ",$_POST['last'] ?>
<br>
</body>
</html>
The final result is the same, but with the GET method we can see the past parameters since they are codified in the URL.