The script I would like to "secure" only have 3 required fields: name, email and message. The e-mail field should only allow one e-mail address, the message field should only allow letters and numbers (and nothing else) and I need the script to filter out: \n, \r, bcc:/i, cc:/i, content-type:/i, etc. Also I would like to prevent "hackers" from removing any of the three required fields.
:-)
[search.cpan.org...]
Ask your host to install it if it's not already installed.
If the message filed really can only contain numbers and letters (but not spaces or punctuation:
if ($message =~ /[\W_]/ or $message eq '') {
do something like print an error message and exit the script
}
what about the name field?
>> Also I would like to prevent "hackers" from removing any of the three required fields.
You can't do that, you can only check if the field has a value or is undefined.