Best way to fill input boxes with dynamic data from a select box

So I'm developing an inhouse webui config tool.

I have a webpage that has a drop down menu of hosts (generating it atm via php calling a python script) and I want it to fill all relevant input boxes with information when selected, then be able to save it and write the changes to a config file (on the sever)

whats the best way to do this? should i rig php to be calling a bunch of python scripts? doing it all in js? or should I make a database and use a combination of them?

Only sidenote is that this needs to run flawlessly long after I'm gone, so I would prefer a "safer" solution over say a "faster" solution.

The description is a little vague in some parts but:

  • Being too depend of the python scripts might add more points of failure (if the scripts get corrupted, accidentally deleted/moved/etc) so if you can replace all with a single file is better and easier to managed.
  • Try to keep a simple as possible, so if replacing all that with a single js file is viable, then most likely is best option.
  • Use json for the config. There function in several language allowing to convert to the native variable types (js, php, etc), allow more a little complex variable types (list, associative arrays,..) and is human readable.
  • Access to a database is many cases is better if want store several chunks of date and consult specific records, but if you don't plan to that and just want to load the config and give directly to the program then it is not worth the effort.
  • Add default configuration where config file is missing. For every software there is a GOOD possibility that the program fail in the future even the the programmer used everything that he could think of. So add comments to you code, add clear variable names and user messages with good info for your successor.

I think I have a solution now.

using node js to return the relevant info and then processing it with client side js.

wow, python, php and node? Are you sure you're doing it the best way for the next person? "Long after I'm gone." Simple is better. I like playing with tech too.. I imagine your php script looks at something like this:

$hosts = system('python args', $val);

So where you're trying to pass information, it comes in arguments. Inputs & Outputs. I would look at json..... this way you have one interface to the dataset. Just create a endpoint with python to the data. I don't know anything about what your looks like or where its getting information from but could work if you're on django.

Then just use javascript/jQuery to talk to the object.