Hello. I need to make a site that checks codes from an input field against a database of verified codes. In other words, checking for matches. Remember those Coca Cola codes, where you could get points? Yeah, like that. I know it's really simple I just want to know the best way to do it, and at least a couple of basic steps on how to implement it. And please don't post service offers or anything, I need to do this myself. Also, if the user's code is a match, they would then need to enter their e-mail and address, and the site would need to e-mail them their winning number and address. -Thanks in Advance
This isn't an HTML question. You will need either a backend script (safest) or you might be able to get away with Javascript in the HTML page itself but then clevah treva's will just figure out valid codes from your source. : ) So, this is very similar to a form validation issue and this is accomplished with your back-end language of choice (PHP, Python, Perl, whatever you're using). When the results match, you'll have a (backend) redirect bringing the visitor to the new form who asks for more information (or I suppose you could AJAX it and add more questions to the current form page or whatever, but I wouldn't). Try the Programming forums.
Depending on how valuable the prize is, instead of using a database of verified codes, you could use a formula that checks for a valid code. e.g the numbers in a code must add up to 1000 to be valid. Valid - Q364A636WH Valid - PR854AQ146D Valid - PM977D23WQ Invalid - OY387LK13M You'd obviously want to make it a bit more complicated than that though. Here's a nice post