I'm writing a sendmail script in PHP at the moment. It's largely based around what a user selects in a menu dropdown.The menu looks like this:
<select name="program">
<option value="Red Program">Red Program</option>
<option value="Green Program">Green Program</option>
<option value="Yellow Program">Yellow Program</option>
<option value="Blue Program">Blue Program</option>
<option value="Orange Program">Orange Program</option>
...
I'll need to evaluate what option has been selected from this menu and send the title of the program to someone in an email. However, half of the programs will need to be sent to one address, the other half to a different address. What's the best way to both return the name of the program and evaluate what has been selected to see what address it should be sent to?
Is there an easier way than writing an if statement for every possible value? Thanks!