started work on db install script

started work on db install script, need to write logic, form, and finish
declaring variables, but making progress.
started work on form and db script
continuing work
continued work on install script, slight restruct

Having the entire installation run in one page is proving difficult.
Will split it out for now and engineer a fix later if practical.
fixed issue with returning state variable

I'd forgotten how to return POST properly, my bad. Now I can actually
get on with the useful stuff.
added code for writing config file

Now running the install script should write the database login details
to a new config.php file (creating a new file and writing it that way
seems easiest). Once the actual SQL script is in, I should move this so
it only does it if the DB query is successful, or I could reload the
page with a different state flag to avoid code duplication.
got SQL create dump from old DB, needs fixing

just needed to get it in the code
quick change to db script

might fix it, untested as of yet.
Finishing up db script work

The only changes needed for this file for now is a minor change to
encrypt/decrypt the password.
updated db references

made sure everything uses the config db values, plus a few other fixes
and tidy ups. No password encryption stuff in this commit
OOPS: Didn't mean to leave the config file in

However, there's an example file there instead, if needed.