<p>You'd do this wiht a Craft plugin or module.</p>

<p>Try giving the plugin docs a once over: <a href="https://docs.craftcms.com/v3/extend" rel="nofollow noreferrer">https://docs.craftcms.com/v3/extend</a> and if you have some specific questions, feel free to post back.</p>

<p>You can also generate Craft plugin boilerplate code at <a href="https://pluginfactory.io" rel="nofollow noreferrer">https://pluginfactory.io</a> that already has a lot of this setup for you.</p>

CC BY-SA 4.0
2020-03-27T05:05:08.037Z
i never thought my quetsion would get answered ,thanx a lot man...btw i already knew that much.
jamesSeb
CC BY-SA 4.0
2020-03-25T22:39:40.543Z
2020-03-25T22:39:40.543Z
Brad Bell
<p>where do you handle the POST requests?
where do you write the validation rules and flash error messages?
where do you write save to db code?
(mainly i want to know how do you route a POST request to a controller and where do you write the controller?)</p>

<form><controller>
How to save data from a form in Craft? Explain with an example?
# How to save data from a form in Craft? Explain with an example?

(Asked by: username_0 on 2020-03-25)

where do you handle the POST requests?
where do you write the validation rules and flash error messages?
where do you write save to db code?
(mainly i want to know how do you route a POST request to a controller and where do you write the controller?)

**Tags:** form, controller

---

## 1 answers

### Answer by username_1 on 2020-03-25. Score: 1

You'd do this wiht a Craft plugin or module.

Try giving the plugin docs a once over: <https://docs.craftcms.com/v3/extend> and if you have some specific questions, feel free to post back.

You can also generate Craft plugin boilerplate code at <https://pluginfactory.io> that already has a lot of this setup for you.

> **Comments:**
> **username_0**: i never thought my quetsion would get answered ,thanx a lot man...btw i already knew that much.  

---

