Ive got a form set up where users can report posts. The page allows them to enter the message id and the choose from a number of radio buttons to which the post had breached and then submit the report
How can i get it so that once the user has entered a message id and clicked a radio button to which the post apply to and click submit, all the data is sent to an email address to where i can review from there?
Also i want it to check if a message id and atleast one radio button has been clicked before submitting and if not displaying a error messages stating they must do this
Thanks
Use the mail() function (as long as your server is configured with an MTA, otherwise you’ll need to use a PHP SMTP client, which is much messier).
Edit: had missed your requirement for form validation. That should really be a separate question, but while you can check in JavaScript you will need a fallback validation in PHP otherwise people can bypass your checks. So, something like:
should be what you need. Just be sure the checkboxes have [] on the end of the name (something like name=”checkboxes[]”) — otherwise you need to do something hairy like:
or