PHP Form Create

Last Updated: July 31, 2021

How to create simple PHP-HTML form

You can use $_GET and $_POST global to get form data to your PHP code

PHP – A Simple HTML Form

You can use <form> tag to create form with attribute action and method

<html>
<body>

<form action="welcome.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>

</body>
</html>

In the HTML form, you have the action attribute which can be used to specify where you should pass your data.

In our example you pass data to the post.php file, you can use the $_POST to get the form field data.