I settled upon the idea that maybe the problems I was having with the Javascript getting free run of the file system was due to bad configuration of Apache. A web search resulted in a page which discussed in some depth the setting of security options for various versions of the Apache packages for various OSs. The reason this matters, and it is one of the pitfalls of Open Source, is that each system has a different structure of files and directories to manage security. I found an example that was very close to the setup I have, and I tried it. It seems to work.
I discovered after looking at the server information after I restarted Apache that it is using the module for pHp5. I tried pgpinfo(), and it gave all the expected info, with access to databases enabled.
The issue with documentation for Apache and pHp is that it almost doesn't exist. One has to take a different approach and trust the disorganized experience in user fourms much more than the poorly written online documentation. Buying books doesn't help because what syntax works in some older version on another OS may no longer work in the current configuration. The most reliable information about a specfic problem is most often from users, if you can find it, and you have to read the fourms with a critical eye to be sure the information applies to your situation or not.
Basically, at least how my Apache is configured, pHp scripts, even when inside HTML wrapper need to have the php extension, not HTML. Finding this
out took a look at a distracting forum on the pHp site, and eventually became clear on a USENET newsgroup. "Escaping HTML" is the very first topic in the online language reference. The article in badily written and the fourm linked to it is arcane, mostly dealing the the conflict between XML and pHp tags. Again and again in various places people said to use php? ... ?>, which to HTML is seen as a comment and ignored. The problem I was having is that the pHp parser was eating the first legal command it say and then doing nothing with the rest. That meant that if the first command was echo it would dutifully spit out the rest of the comment, not doing what it wanted. It wasn't until I noticed the comment on the extension that I had something I could try.
It is possible that this problem of extensions is due to my particular Apache configuration since I know that extensions do matter to the server. I want to know what the overhead is if I say that HTML is an extension available to pHp, if that is indeed an alternative approach.
After tearing my hair out for an hour, and I had encountered this before, did I begin to get this working, and yet this depandancy of extensions is not mentioned in the onlime pHp manual. I was then able to progress rapidly into the language.
I even had some fun after the above. One of the examples I had uses the date() function to get the system clock. This takes a cryptic format argument like the strtime() UNIX system call, but you can use it to print a date and time from your system's clock. I decided to have some fun and make a big time display in the browser, but using the hour of the day to set a different color for different hours in the day. I had to use style to set the backgtound to black and dynamically within pHp to get the time, pick a color off an array and set the time in a huge font, changing the color with the time, and I also had to get the browser to reload the script after a set time. This latter is done in the header in one of those little noticed fields: META HTTP-EQUIV=REFRESH CONTENT=30>.