This is not a FileMaker script. What kind of script is this? PHP perhaps?
yes, that is php. FileMaker API http://www.filemaker.com/downloads/pdf/article1_php.pdf
IN which case, you might want to click the FM Server Forum tab and repeat your post there. I havent' seen many posts on PHP here that got much help, but there have been a few such in that section of the forum. You can also join TechNet and post to that forum or one of the other fileMaker forums out there on the web.
I suggest these alternatives because I don't see a lot of reponses from people familiar with PHP here in this forum.