tell-a-friend form emailer, that also writes the submitted data to the database.
- a front-end made to good standards (mobile responsiveness, accessibility etc.)
- a form lets a visitor enter a friend's details
- the form does not allow for empty fields or invalid characters (name field only)
- both the visitor's and the friend's names & email addresses are written to the database
- the form has a button to clear the fields before sending, and a link to clear the fields which appears after submission
- display error message when trying to submit invalid email addresses
- on form submission, an email is sent out on behalf of the visitor, containing the site's URL
-
The easiest way to test the site is to have an all-in-one web service stack such as XAMPP, MAMP, LAMP or WampServer in place.
-
The demo works with a MySQL database containing a recommendations table, which you need to manually set up first. You can choose their names and then specify these in form.php under the $mydatabase and $mytable. $mytable needs the following column names (you must set ID as primary key & to auto-increment):
ID customername customeremail friendsname friendsemail
-
When in production, make sure to comment out the database connection debugging messages in form.php (as indicated in the comments).
-
The website text of the demo is in Italian, but the backend is entirely in English, so it should be fairly straightforward to change the front-end into your local language.