Selecting a variable to use at php mailer
<p>I'm using a simple php mailer for my sites contact form. I have a form asking first for their subject of contact, and if they select a spesific option, then the recipient selection will fade in and you can select the recipient you want to use. BUT. I don't want to write the email addresses in the code, because of spam. So I'm trying to achieve this via php variables. </p>

<p>My mailer looks like this:</p>

<pre><code>&lt;?php
$var1="xxx@gmail.com";
$var2="xxx@gmail.com";
$to = "$_POST[kohde]";
$subject = "$_POST[asia]";
$message = "
$_POST[tiedot]\n
$_POST[nimi]
$_POST[email]
$_POST[puhelin]
IP-osoite: $_POST[ip] ";
$from = "xxx.fi";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
?&gt;
</code></pre>

<p>But using the variable names as is in value wont work. So how would I select the email to use with the option without hard coding the email to the option value?</p>

<pre><code> &lt;select name="kohde" style="width:233px;" &gt;
    &lt;option value="$var1"&gt;xxx.fi&lt;/option&gt;
    &lt;option value="$var"&gt;Sivun tekijälle&lt;/option&gt;
    &lt;/select&gt;
</code></pre>
