Skip to content Skip to sidebar Skip to footer

Php And Javascript Code To Modify A Csv File Entries

I try to describe my complete situation... I read a csv file using php function. I developed a php class that represent an entry of the file. So, I have a php array that contains a

Solution 1:

No, you're not modifying the PHP Array. There are several ways to handle your request. You could use the input fields in your table to make a POST request and save the changes to your CSV file.

The more Javascript-ish way could be an AJAX Request which is fired on change of each field. Your Server / PHP-Code is accepting that request and writes only the data of that field.

In both cases you should know how to handle POST requests / forms in PHP. Submitting a form by POST generates a new PHP array, accessible as $_POST.

Practical examples are depending on the expected behavior. Using forms will reload the page on submitting. Using AJAX not. But the usage of AJAX (XMLHTTPRequest if you want to read some documentation) is a little tricky if you're new to Javascript

Link about XMLHTTPRequest (AJAX) http://www.w3schools.com/xml/xml_http.asp

Link about Form handling: http://www.w3schools.com/php/php_forms.asp

Post a Comment for "Php And Javascript Code To Modify A Csv File Entries"