If it's your server, maybe consider using Perl to write a clean server side code with a decent html interface instead of hacking something together with telnet and shell commands?
holli
You can lead your users to water, but alas, you cannot drown them.