Well, first of all let me say that I can't even begin to tell you how grateful I am for your efforts in sorting out my script.
I took a close look at the stuff that you wrote and tried it out.
There were one or two inevitable parse errors on your script but after I corrected those minor typos I ran the thing and guess what? -it behaved exactly the same as the script that I had written! Yes, that's right.... it got an internal server error.
I've considered the criticisms of my script that you made and I am very grateful for your comments. However, I think that none of the flaws that you mentioned are enough to warrent a 500 Internal Server Error.
Things like using "AND" instead of "&&" or writing "if ($apples=='green') {" instead of "if ('green'==$apples) {" strike me as being simply a matter of choice or personal style that we have as PHP users. The particular style of scriptwriting that I use has never given me any problems before.
I know that this sounds like the ultimate case of a bad worker blaming his tools, but I am starting to seriously suspect that there's a problem with my PHP engine.
I would be happy to send you every single line of code from the original HTML form, to the form processing script (that we've been working on) to the error page... just to see if it works on someone else's computer. However, I certainly wouldn't blame you for not being interested.
The one piece of good news with this mystery is that there is, I think, a better way to write the script anyway- a method that avoids doing all those header redirects and simply deals with the error(s) there and then. I think I'll try that approach instead.
Thanks again for your help.