This is one for some really smart people:
My php script works nicely, so that is not the issue.
I have been working on this for over a year, and have done loads and loads of research, but to no avail. I assume that there is something high-level that I am missing here, not just coding.
Thanks in advance to everyone.