Skip to content
Advertisement

How to get data from html-table via php

I have html-table and three buttons:

JavaScript

You can see there are no rows in it by default.

In javascript I add rows and cells by clicking the button “Add”. Also I can delete them by clicking the button “Delete”.

When I finish adding rows and cells I click the button “Save”. And by clicking “Save” I want to save the information in txt-file, for example. I know how. As I am new in php, I am not an IT-guy, I do not want to work with MySQL, ajax, etc.

How is it possible to just take the information for html-table by php. In test.php I wrote:

JavaScript

to check whether I get the information or not. So I do not.

If you ask yourself why someone do not want to work with mysql and want to save the information in txt-file I can answer: it is probably easier for me as there is not so much information I will work with and I will not have to learn how to work with MySQL.

Advertisement

Answer

In order to pass along the data to PHP the HTML your using must have items in the form with names. Here is how that could look for you.

index.html

JavaScript

test.php

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement