Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2007
    Posts
    11
    Thanks
    2
    Thanked 0 Times in 0 Posts

    need to restricting forms submits based on data

    I have a form located here https://www.lgw.com/dev/sampleformcard.htm

    and I'd like to stop people from submitting the form if there credit card starts with several different combination of 4 numbers.

    The list is very long (almost 300 different combo) and I was looking for suggestions on how I could accomplish this.

    My first thought was it break up the one field into 4 fields, (like the four groups of numbers on your credit card) and just run the filter on the first field.

    would I use JavaScipt and run it against a CSV file? or maybe PHP?

    Any direction would be helpful.


    Regards,
    Chris

  • #2
    New Coder
    Join Date
    Jan 2008
    Posts
    63
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Well, if it's critical that CC numbers that start with those digits don't get submitted, you should avoid javascript - since anyone with javascript turned off could bypass it.

    Server side, whatever language you want should work. I'd put the numbers in a file, run through the file creating an array/hash of bad numbers, then do a simple "if" check to see if the number submitted is in that array/hash.
    Web hosting by coders, for coders: php hosting - Magento eCommerce hosting - perl hosting - check us out!

  • #3
    New Coder
    Join Date
    Sep 2007
    Posts
    11
    Thanks
    2
    Thanked 0 Times in 0 Posts
    anyway I could just get an simple example I could learn off of?


    is this in PHP or something else?


  •  

    Posting Permissions

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