How to make an HTML form really work?

Good day, downloaded from html5up template (html+js+css) in this template has a contact form:

<form method="post" action="#">
 <div class="fields">
 <div class="field half">
 <label for="name">Name</label>
 <input type="text" name="name" id="name" />
</div>
 <div class="field half">
 <label for="email">Email</label>
 <input type="email" name="email" id="email" />
</div>
 <div class="field">
 <label for="message">Message</label>
 <textarea name="message" id="message" rows="4"></textarea>
</div>
</div>
 <ul class="actions">
 <p><input type="submit" value="Send Message" class="button primary" /></li>
</ul>
</form>


It is clear that this is just a form template. How really to do that to connect to this form actually asked for information and somewhere they are sent/ recorded? At the moment it's just a "plug"..
Thank you!
March 19th 20 at 09:00
3 answers
March 19th 20 at 09:02
Solution
form already sends data to the specified action, i.e. nowhere.
Depends on what your server supports there are different ways to obtain data and to manipulate them.
If the server has support for php, you can create a file mail.php at the root of the website, and specify the form action="/mail.php". This means that the data will go to this file and we have to write a code which will be something with this data at, for example, like this:
<?php
$email = "кудаприходитпочта@mail.ru";
$title = "some subject";
$headers = "Content-type: text/html; charset=utf-8";
$msg = "<p>the name of the sender: ".$_POST['name']."</p>
 <p>Email:".$_POST['email']."</p>
 <p>the Message of the sender: ".$_POST['message']."</p>";
// send mail
mail($email, $title, $msg, $headers);
March 19th 20 at 09:04
Depends on what action will handle it - wm-school.ru/html/html_forms.html
And what hinders to use the services with spam protection, etc. n?
And what kind of services? I'd be happy to use. At least one example? Thank you! - murphy.Dooley commented on March 19th 20 at 09:07
CleanTalk and analogues - Rossie.La commented on March 19th 20 at 09:10
March 19th 20 at 09:06
Need script for this form. If You are using a CMS, view scripts and add-ons for this CMS.

If you just have a html website that is ready php scripts for feedback forms. Configure it and use it.

Or use third-party services for forms by type copiny.com

Find more questions by tags HTML