title: PHP GET Form Based on Leading Characters of User Input
body: <p>I am looking for a way to direct a PHP form to a specific URL based on the user input.  For example:</p>
  
  <p>If user enters AA123 the URL would be <a href="http://sample.com/cgi-bin/lookup.cgi?OPT_M=" rel="nofollow">http://sample.com/cgi-bin/lookup.cgi?OPT_M=</a><strong>AA</strong>_DETAIL&amp;TICKET=<strong>AA123</strong></p>
  
  <p>If user enters BB123 the URL would be <a href="http://sample.com/cgi-bin/lookup.cgi?OPT_M=" rel="nofollow">http://sample.com/cgi-bin/lookup.cgi?OPT_M=</a><strong>BB</strong>_DETAIL&amp;TICKET=<strong>BB123</strong></p>
  
  <p>Any assistance is greatly appreciated.</p>
  
  <p>Added:</p>
  
  <p>I am able to create 2 separate radio buttons to accomplish this but would really like to do it without selecting the type.  I am not sure where to go next.  Below is what I have so far:</p>
  
  <p><code>
      &lt;form action="http://sample.com/cgi-bin/ticket.cgi" method="get"&gt;
      &lt;input type="radio" name="OPT_M" value="AA_DETAIL" /&gt;AA
      &lt;input type="radio" name="OPT_M" value="BB_DETAIL" /&gt;BB
      Ticket: &lt;input type="text" name="Ticket" /&gt;&lt;br /&gt;
      &lt;input type="submit" value="Send" /&gt;
      &lt;/form&gt;
  </code></p>