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

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Save post data on index/index.php

4 REPLIES 4

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

Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

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

Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Save post data on index/index.php

You can get reference from below post,

http://clever-code.com/how-to-save-form-data-to-the-custom-table-in-magento-2/

From BSS Commerce,

https://bsscommerce.com/confluence/how-to-create-insert-data-into-the-table-in-magento-2.html

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial