#72 Processing Contact Forms

While sophisticated CGI programming is almost always done in either Perl or C, simple tasks can often be accomplished with a shell script. There are some security issues of which you should be conscious, because it's rather easy to inadvertently pass a dangerous parameter (for example, an email address that a user enters) from a form to the shell for evaluation, which a hacker might exploit. However, these potential security holes will likely never arise if your CGI needs are sufficiently modest.

A very common page on a website is a contact request form, which is fed to the server for processing and then emailed to the appropriate party within the organization. Here's the HTML source for a simple form (with a ...

Get Wicked Cool Shell Scripts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.