about code form
<!DOCTYPE html>
<html>
<head>
<title>Contact Form</title>
</head>
<body>
<h2>Contact Us</h2>
<form action = "submit_form.php" method = "post">
<label for = "name"> Full Name: </label> <br>
<input type = "text" id = "name" name = "name" required> <br> <br>
<label for = "email"> Email Address: </label> <br>
<input type = "email" id = "email" name = "email" required> <br> <br>
<label for = "message"> Message: </label> <br>
<textarea id = "message" name = "message" rows = "5" cols = "30" required> </textarea> <br> <br>
<input type = "submit" value = "Submit">
</form>
</body>
</html>
Explanation:
-
form: defines the form, withactionbeing the page where data will be sent (eg,submit_form.php), andmethod="post"to send data securely. -
input type="text": for the user's full name. -
input type="email": for email address with built-in validation. -
textarea: for a longer message. -
input type="submit": a button to send the form data.