YaroslavVB: Errr. Taking text from a user to feed to exec() is a Bad Idea in general... Unless you REALLY TRUST them and they know what they are doing, in which case you'd be better off just giving them a shell account.
YaroslavVB: Require Reading: http://phpsec.org
http://php.net/exec (which does the part you are asking)