Parse error: syntax error, unexpected $end in
Creating a contact form using classes part 1
Table of contents for Contact Form
- Creating a contact form using classes part 1
Recently I was asked at work to build a PHP email contact form that could do some specific things.
- Allow the user to choose different departments/emails to send their submission to
- Allow the user to input specific things into boxes such as telephone number, order ID
- Be easy to extend so a non programmer could add an extra input at a later date
Then there were a few things I wanted to do.
- Use classes to separate logic from layout
- Clean and validate all input
Now there’s a lot of websites that show you how to do email forms, but most just send a users email address, name and message via post to a separate PHP file and then compose and email. While this is nice, simple and works it doesn’t allow for all the things that was asked and I felt should be done.
In part 2 I’ll show you how I started to build my classes.
| Print article | This entry was posted by clutz on 20/09/2010 at 7:06 pm, and is filed under php. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |