This is not form validation — and how to fix it

August 31st, 2009 § 0 comments § permalink

I was working on a site and noticed something that concerned me.  This is fodder for TheDailyWTF and makes me worry for the fate of any person who receives the results of forms with [non-]“validation” like this. The form element: <select name="favorite-color">  <option>Favorite Color – Choose One</option>  <option value="blue">Blue</option>  <option value="red">Red</option>  <option value="orange">Orange</option>  <option value="green">Green</option>  <option value="black">Black</option> </select> Here is what was in the processing script: switch ($_POST["favorite-color"]) {  case "blue":  case "red":  case "orange":  case "green":  case "black":   $data["favorite-color"] = $_POST["favorite-color"];   break; } … //data is appended to a string – matt's comment not a "real" comment in the script $string .= $data['favorite-color']; So… What is wrong with this? OMG what isn’t wrong with it? The select… » Read More

Services

January 18th, 2009 § 0 comments § permalink

Matt Bernier provides a list of services for your web-based needs including proposal consulting, website consulting, search engine optimization consulting, and website development. If you are interested in any of these services please contact me ASAP. Sphere: Related Content… » Read More

Where Am I?

You are currently browsing entries tagged with Database at Matt Bernier.


Warning: Cannot modify header information - headers already sent by (output started at /home/seoclear/mkbernier.com/wp-content/themes/oulipo/functions.php:23) in /home/seoclear/mkbernier.com/wp-content/themes/oulipo/footer.php on line 24