Results 1 to 5 of 5

Thread: PHP Form verification: preg or built in functions

  1. #1
    DickTracy is offline Newbie Net Builder
    Join Date
    Dec 2008
    Posts
    116
    Thanks
    12
    Thanked 19 Times in 12 Posts

    PHP Form verification: preg or built in functions

    I currently use separate functions to verify form data eg regular expressions to check email addresses, and other functions for length, cleaning the data etc

    I see there are now also built in functions to check form data
    eg filter_var($email,FILTER_VALIDATE_EMAIL); to check email addresses

    Which is the best approach (ie most secure, fastest)? Use separate functions that I write or modify myself or to use the built in functions?

    Cheers

  2. #2
    Diesel's Avatar
    Diesel is offline DJuice Net Builder
    Join Date
    Jun 2009
    Location
    Heartbeat City
    Posts
    180
    Thanks
    66
    Thanked 48 Times in 43 Posts

  3. #3
    Keldorn's Avatar
    Keldorn is offline Net Builder
    Join Date
    Dec 2008
    Location
    Canada
    Posts
    400
    Thanks
    21
    Thanked 60 Times in 52 Posts
    Yeah I dont use those either, I use my own functions for validating strings.
    Submit new proxies -

  4. #4
    DickTracy is offline Newbie Net Builder
    Join Date
    Dec 2008
    Posts
    116
    Thanks
    12
    Thanked 19 Times in 12 Posts
    Why is that Keldorn?
    Just because you've always done it that way (same as me) or because you think the built in functions don't work as well as your own functions?
    Cheers

  5. #5
    Keldorn's Avatar
    Keldorn is offline Net Builder
    Join Date
    Dec 2008
    Location
    Canada
    Posts
    400
    Thanks
    21
    Thanked 60 Times in 52 Posts
    Its just more stuff I have to remember. I'm a bit too lazy to look threw the filter_var manual. I already have email validation covered already.
    So far I haven't found a need to look threw the filter_var for anything that I am having trouble with, but I probably will someday might take interest its in IP validation method.
    Submit new proxies -

Similar Threads

  1. Glittering administrative functions
    By ViDonaghuehkkf in forum Services
    Replies: 0
    Last Post: 1 February, 2011, 06:15 AM
  2. Replies: 4
    Last Post: 13 November, 2009, 13:26 PM
  3. Simple CAPTCHA Verification Form
    By mega in forum Programming
    Replies: 1
    Last Post: 18 October, 2009, 19:01 PM
  4. PayPal Verification with a VCC
    By sivasriram in forum Business
    Replies: 14
    Last Post: 31 July, 2009, 08:08 AM
  5. Use PHP functions in JavaScript
    By ankit in forum Programming
    Replies: 3
    Last Post: 31 May, 2009, 10:12 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •