Hi!
I´m trying to create a new module which should help me maintain a custom database table.
I started out using Susan´s tutorial the this subject:
http://www.sottwell.com/create-module.html
What I have, is a module in MODx, which includes a index.php file. This file starts out with if(IN_MANAGER_MODE!="true") die("Your INCLUDE_ORDERING_ERROR here");
and the files works as intended. I can - from the index.php file - access the database tables and retrieve all the data from it.
On the index.php file, I have added a link to a new page, called "insert_new_row.php", which just contains a form with some simple input-fields.
What I want to do is this: set the form action to ’../assets/modules/myModule/index.php’, when the form is submitted, it sends the form-data back to the index.php file.
I was thinking of having all the PHP/MySQL action on the index.php file.
BUT here is the catch! When I submit the form, it goes back to the "index.php", but now the file is "accessed" from outside the manager, and I now get the "INCLUDE_ORDERING_ERROR".
I have tried using the AJAX solution, but I ran into some other problems ( when using AJAX the DOM was not properly updated, and when I submitted the first form, everything worked, but the next time I submitted the form, all of the values where the same values as in the first form-submit).
Anyone have any helpful suggestions?