HassaMassa
Modder
Divine
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
300 XP
Using the HTML Form is very important in creating a PHP application, because it serves as a holder of information from a website's visitors and then use the PHP to process that information.
Heres the simple HTML Form.
The code below is a simple HTML Form with a two input boxes for Fullname, E-mail Address and a submit button. When the user click the submit button, the data in the form will be sent to the HTTP POST method to be processed in a PHP file called “processData.php”.
Output:
Code for processData.php:
The code above will simply display the data that has been passed from HTML Form using the superglobal ”$_POST[]” variable. And the output of this application looks like as shown below:
Your Fullname is: Joken Villanueva
Your Email address is: [email protected]
Book traversal links for PHP Forms
Heres the simple HTML Form.
The code below is a simple HTML Form with a two input boxes for Fullname, E-mail Address and a submit button. When the user click the submit button, the data in the form will be sent to the HTTP POST method to be processed in a PHP file called “processData.php”.
- <
html>
- <
body>
- <
h1>
Sample HTML Form</
h1>
- <
form action=
"processData.php"
method=
"post"
>
- FullName:<
input type=
"text"
name=
"fullname"
><
br>
- E-
mail
Address:
<
input type=
"text"
name=
"email"
><
br>
- <
input type=
"submit"
>
- </
form>
- </
body>
- </
html>
Output:

Code for processData.php:
- <?php
- echo
'Your Fullname is: '
.
$_POST
[
'fullname'
]
;
- echo
'<br/>'
;
- echo
'Your Email address is: '
.
$_POST
[
'email'
]
;
- ?>
The code above will simply display the data that has been passed from HTML Form using the superglobal ”$_POST[]” variable. And the output of this application looks like as shown below:
Your Fullname is: Joken Villanueva
Your Email address is: [email protected]
Book traversal links for PHP Forms
- ‹ PHP Foreach Loop
- Up
- PHP Get ID Of Last Inserted Data In MySQL ›