in reply to Need help with security

Below is a script i have wrote which i realy need someone to check over to make sure it is secure.

The quick answer, based seeing none of

is "probably not." And on closer examination, your URL decoding logic is buggy. Don't roll your own logic. Let CGI.pm do it for you. And on closer examination, there's nothing to prevent someone from forging a form that contain a username of   ;/bin/rm -f *\n

If one of you geniuses could modify my code to perform the above, it would be most appreciated

You'll learn more, and will be better off in the long run, if you put some more work in on this yourself. We'll be happy to re-review your work, and offer pointers.

One such pointer is that you might find it worthwhile to read Ovid's Web Programming User Perl course. You'll find most, if not all, of what you need there.