# Get the form fields to content folder from on the front end

**URL:** <https://forum.getkirby.com/t/get-the-form-fields-to-content-folder-from-on-the-front-end/257>\
**Category:** Questions\
**Tags:** v2\
**Created:** [March 4, 2015, 7:41am UTC](https://forum.getkirby.com/t/get-the-form-fields-to-content-folder-from-on-the-front-end/257 "2015-03-04T07:41:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![aristotheme](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/aristotheme/32/178_2.png) [@aristotheme](https://forum.getkirby.com/u/aristotheme)\
**Post date:** [March 4, 2015, 7:41am UTC](https://forum.getkirby.com/t/get-the-form-fields-to-content-folder-from-on-the-front-end/257/1 "2015-03-04T07:41:15Z")

</div>

Hi everyone

I have working on new project with my client. Let me explain what i need.

- Visitors will come to register to website. And they will enter their info via form. (name, surname, etc.)
- When they finish to fill in form, they will click to ‘save’ button and their information will save our Kirby ‘content/registers’ folder. As a panel but this time it must be on front end.
- After that i want to get all users info from ‘content/registers’ to panel. Administrator will see the registers in the form of list. Administrator will able to change and modify registers information.

How can i do it? especially get to visitors info from front end to content/registers.

---

<div class="post-metadata">

**Author:** ![andi242](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/andi242/32/3132_2.png) [@andi242](https://forum.getkirby.com/u/andi242)\
**Post date:** [March 4, 2015, 9:26am UTC](https://forum.getkirby.com/t/get-the-form-fields-to-content-folder-from-on-the-front-end/257/2 "2015-03-04T09:26:54Z")

</div>

I am not sure if I get it right…  
Do you wish to filter content if users are not logged in?

If so, you could just let kirby control your accounts and do something like this:

```
if(empty(site()->user())){
    // user not logged in while "empty" is true...
} else {
	// do user 'logged in' stuff...
}

```

This requires kirby users to be created. I am not sure if this works with “read txt, filter user, check password” method, you are suggesting.

If I am not mistaken you are planning to save user logins in plain text to ‘content/registers’, this might be not the best option, if not encrypted & stuff…

why not let kirby do the user administration?  
This would require kirby to have user roles, though (no panel for ‘readers’).  
be sure to check this, too:  
[http://getkirby.com/docs/cheatsheet/user/has-role](http://getkirby.com/docs/cheatsheet/user/has-role)  
[http://getkirby.com/docs/cheatsheet/user/is](http://getkirby.com/docs/cheatsheet/user/is)

---

<div class="post-metadata">

**Author:** ![aristotheme](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/aristotheme/32/178_2.png) [@aristotheme](https://forum.getkirby.com/u/aristotheme)\
**Post date:** [March 4, 2015, 10:03am UTC](https://forum.getkirby.com/t/get-the-form-fields-to-content-folder-from-on-the-front-end/257/3 "2015-03-04T10:03:35Z")

</div>

Hi Thank you for your helping

I just want to get users informations without login. Only They will fill in form and save their info in ‘content/registers’ folder, they will leave their info to us. We will keep their info in ‘content/registers’ folder.

Regards

---

<div class="post-metadata">

**Author:** ![andi242](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/andi242/32/3132_2.png) [@andi242](https://forum.getkirby.com/u/andi242)\
**Post date:** [March 4, 2015, 10:11am UTC](https://forum.getkirby.com/t/get-the-form-fields-to-content-folder-from-on-the-front-end/257/4 "2015-03-04T10:11:19Z")

</div>

Ah, I see… Like collecting email adresses and information for newsletters, etc.?

I believe that this would just require a form and the handling with file operations.  
[http://getkirby.com/docs/toolkit/api/f/append](http://getkirby.com/docs/toolkit/api/f/append)

Just grab the html form content and append it to a file.  
With json you are able to grab the data and work with it from the file.

I saw something similar within the comments plugin: [https://github.com/vladstudio/vladstudio-kirby-comments](https://github.com/vladstudio/vladstudio-kirby-comments)

~~perhaps you can grab some ideas from there.~~

Even better: You could use the comments plugin for this.  
Just use the form to add information to a specific page/folder.  
It saves any information submitted in a form to a .json file which can be used for your purposes.

**Be sure to take this version if you are on Kirby 2:**

> **[Kirby 2 (Beta 1) comments plugin | DerZyklop](https://der-zyklop.de/blog/kirby-2-beta-1-comments-plugin)**
>
> This is for those who are already playing around with Kirby 2 Beta 1 which was released this monday. This is a very early version of Kirby 1. So the migration from Kirby 1 to Kirby 2 is still a bit rough. When there is a stable version of Kirby 2…

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [March 4, 2015, 10:41am UTC](https://forum.getkirby.com/t/get-the-form-fields-to-content-folder-from-on-the-front-end/257/5 "2015-03-04T10:41:52Z")

</div>

Or you could create a subpage to `registers` for each submission.  
Have a form in a front-end template `registers.php` and use a [page controller](http://getkirby.com/docs/templates/controllers) to save the submitted data.

You can get your form data within the controller with:

```auto
get('fieldname');

```

And to create/update a page you can do something similar to this:

```auto
try {
          page('registers/'.get('name'))->update(array(
              'title' => get('name'),
              'degree' => get('degree'),
              'email' => get('email')
          ));
          $error = false;

        } catch(Exception $e) {
            $error = true;
            echo 'The user could not be updated';
            echo $e->getMessage();
        }

```

Not that you should not actually create/update the subpage with the direct from field data, but first have some validation on it. It’s just like this in there to simplify the example.

The benefits of this way are that you can easily [add a blueprint](http://getkirby.com/docs/panel/blueprints) to access that data conveniently through the panel.

---

<div class="post-metadata">

**Author:** ![aristotheme](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/aristotheme/32/178_2.png) [@aristotheme](https://forum.getkirby.com/u/aristotheme)\
**Post date:** [March 4, 2015, 10:55am UTC](https://forum.getkirby.com/t/get-the-form-fields-to-content-folder-from-on-the-front-end/257/6 "2015-03-04T10:55:02Z")

</div>

> [@andi242](#):
>
> [Kirby 2 (Beta 1) comments plugin - DerZyklop](http://der-zyklop.de/blog/kirby-2-beta-1-comments-plugin)

Thank you very much Andi!  
I will try it.

Also i guess this will help to me ;  
[https://github.com/vladstudio/vladstudio-kirby-smart-submit](https://github.com/vladstudio/vladstudio-kirby-smart-submit)

---

<div class="post-metadata">

**Author:** ![aristotheme](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/aristotheme/32/178_2.png) [@aristotheme](https://forum.getkirby.com/u/aristotheme)\
**Post date:** [March 4, 2015, 10:58am UTC](https://forum.getkirby.com/t/get-the-form-fields-to-content-folder-from-on-the-front-end/257/7 "2015-03-04T10:58:06Z")

</div>

Yep Nico very nice way

Thank you very much!

---

<div class="post-metadata">

**Author:** ![Thiousi](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thiousi/32/13656_2.png) [@Thiousi](https://forum.getkirby.com/u/Thiousi)\
**Post date:** [July 23, 2016, 1:15pm UTC](https://forum.getkirby.com/t/get-the-form-fields-to-content-folder-from-on-the-front-end/257/8 "2016-07-23T13:15:15Z")

</div>

Hey sorry to revive such an old topic. Would you be willing to share your final code @aristotheme ?  
I’m looking for a similar solution and may as well not reinvent the wheel 🙂

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 4:57pm UTC](https://forum.getkirby.com/t/get-the-form-fields-to-content-folder-from-on-the-front-end/257/9 "2025-02-06T16:57:30Z")

</div>


