Jump to content



Photo

Adding "Subject" Field To Php Form In Chapter 10 W/Spam Protection


  • Please log in to reply
2 replies to this topic

#1 Leon35

Leon35

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 21 February 2012 - 4:21 PM

I have completed and tested the basic PHP form that is detailed in Chapter 10 and I have also edited the form with the spam settings as shown in Chapter 12. I have tested
it and it's works fine with no issues etc. My only problem is that I ideally need a "subject" field within the form.

I am unsure of how I would go about adding this field along with the appropriate spam protection.

Any help would be appreciated.
  • 0

#2 HartleySan

HartleySan

    Advanced Member

  • Members
  • PipPipPip
  • 2,900 posts
  • LocationColumbus, OH USA

Posted 21 February 2012 - 9:19 PM

I'd start off by adding another input field to your email form. I imagine you will want to use a text input element for the subject.

On the PHP side, you will then want to scrub the data entered into the subject field by the user. I imagine that you can perform the same tests on the subject field as you already have for any other text fields (i.e., make sure no email-specific key phrases have been entered or JavaScript has been inserted, etc.).
  • 1

#3 Leon35

Leon35

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 22 February 2012 - 5:44 AM

Thanks for your help Hartley, much appreciated!
  • 0