When an HTML form is submitted to a PHP page, the data becomes available to that script.
An HTML form
has two required attributes: action
. The action attribute specifies the script file to which the form data is passed when the form is submitted. For example, the following form submits one input property called myString
to the mypage.php
<?php // myform.php ?>
<form action="mypage.php" method="post">
<input type="text" name="myString">
The second required attribute of the form element ...