in reply to If/else problems
While you don't tell us much about your environment, you can typically check the server logs to find any error messages that your script printed. I've done this many times and tend to keep a "tail -f /var/log/httpd/error_log" going while I'm developing my script. Makes debugging quick and easy.