cancel
Showing results for 
Search instead for 
Did you mean: 

Save post data on index/index.php

SOLVED

Save post data on index/index.php

Why is so dificult to save and update data on index/index.php file?

Anyone has any idea?

I try to follow the tutorials on the web but there is always something wrong.

Thx

Tags (1)
4 REPLIES

Re: Save post data on index/index.php

Hello,

You need to share you code to debug it

Make sure folder name should be right e.g folder name Index not index
Same for controller file name.

Hope it will help you

Re: Save post data on index/index.php


@Sunil Patel wrote:
Hello,

You need to share you code to debug it

Make sure folder name should be right e.g folder name Index not index
Same for controller file name.

Hope it will help you

HelloSunil,

my code is just this:

app/code/bi/BiPerguntas/Controller/Adminhtml/Index/Index.php

$postData = $this->getRequest()->getPost();
if (!empty($postData)) {

}

 

inside the post data I have the posta from the form.

Now, the question is how do I save this on magento 2?

Thanks mate

Re: Save post data on index/index.php

Hello

If you want to do save into custom table then you need to create model for that.

Sample module:https://github.com/cedcommerce/magento-2-sample-module/tree/master/YourModuleName/Controller/Adminht...

Hope it will help you.

If you like then give kudoes

Re: Save post data on index/index.php