Validations to the max!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • havealot
    New Member
    • Jul 2015
    • 6

    Validations to the max!

    Hey my friends , I have a task which is to validate a form for contact_us page , which consist of email,subject and the message.
    my question is what validations do you think should I make ?

    by now I've made email validation for the email format, and maximum and minimum chars limit for the subject with only letters available , and for the message only minimum number of char limit.

    I hope you could help , thanks.
  • computerfox
    Contributor
    • Mar 2010
    • 276

    #2
    Ideally, you'd want to validate the content if it's an actual query, especially if these will be posted on the website. Also, make sure you log some information such as IP address, it's really good for YOUR documentation and security. I do it on all of my websites. It's legal because you're not really grabbing anything from their machine, just their IP which every site does anyway and information about their browser through their header. Also, pages with underscores tend to have a negative affect for SEO and really doesn't look clean.

    As for the email, you're only checking if it's "valid", but is it really valid? Is it a valid domain or a valid TLD? Does that email exist on that domain?

    Comment

    • havealot
      New Member
      • Jul 2015
      • 6

      #3
      actually it's not what you think,
      I'm not using any Databases for now, it's just a simple task to validate the inputs of the form using PHP.
      Although I really want to know how to make this happen (getting IP address and Browser's Info).
      about the email validation , what I meant is I validate the email format using PHP filter_var().

      and finally I would like to thank you for these information :D

      Comment

      Working...