title: Query String Redirection: How to change form input to URL?
body: <p>Right now I am working on a  project to create a very basic combination lock style navigational form where inputting different codes takes you to specific URLs. (This is only for a puzzle so it doesn't have to be secure.)</p>
  
  <p>I created a simple keypad with an HTML form (itself derived from 
  <a href="http://forums.codeguru.com/showthread.php?464634-HTML-Keypad&amp;p=1778910#post1778910" rel="nofollow">this old forum post</a>) which uses a basic GET method to append a query string like <code>?code=ABC123</code> to a specified URL.</p>
  
  <blockquote>
    <p><a href="http://codepen.io/somethingformed/pen/bkglq" rel="nofollow">Current working keypad demo in CodePen</a>.</p>
  </blockquote>
  
  <p>Now I would like to be able to parse the output in such a way that entering a specific code takes you to a corresponding page. I looked at ways to manage this kind of action with Python/Perl/CGI, PHP, Ruby on Rails... and I see I just need to craft a very simple script that checks the code against an array with some simple logic like this:  </p>
  
  <ul>
  <li>If string is ABC123, go to /page/here.html</li>
  <li>If string is FF0000, go to /page/red.html</li>
  <li>(etc.)</li>
  <li>If string is anything else, go to 404.html (or better, show an error and not leave the page at all.)</li>
  </ul>
  
  <p>I feel really close since I'm already consistently producing a <code>?code=XXXXXX</code> from this form, I just can't figure out how to turn that into actually performing the action of directing the visitor away from the keypad and toward a page whose code they just entered. The answer seems really obvious to me but after several hours of fiddling I haven't hit upon the right answer. I'd prefer to do this in JavaScript or a PHP script. </p>
  
  <p>How do I go about creating this behavior?</p>