php contact form, thank you page
<p>Below is my php contact form:</p>

<p>Page the user inputs information:</p>

<pre><code>&lt;div style="padding-left: 50px"&gt;
&lt;p class="arial"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;form action="freecontact2formprocess.php" method="post"&gt; 
&lt;table class="freecontact2form" border="0" width="400px"&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td colspan="2"&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt; &lt;font color=#E42217 &gt;Please ensure all card details are correct.&lt;/font&gt;
  &lt;br /&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td valign="top"&gt;&lt;table width="400px" class="freecontact2form"&gt;
    &lt;tr&gt;
      &lt;td colspan="2"&gt;&lt;br /&gt;
        &lt;br /&gt;
        &lt;div class="freecontact2formmessage"&gt; &lt;/div&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
  &lt;td valign="top"&gt;&lt;label for="subject_type" &gt;Subject Type:&lt;span class="required_star"&gt; * &lt;/span&gt;&lt;/label&gt;&lt;/td&gt;
  &lt;td valign="top"&gt;&lt;select name="subject_type" id="subject_type"&gt;
    &lt;option selected="selected" value ="Maths"&gt;Maths&lt;/option&gt;
    &lt;option value ="English"&gt;English&lt;/option&gt;
    &lt;option value ="Biology"&gt;Biology&lt;/option&gt;
    &lt;option value ="Chemistry"&gt;Chemistry&lt;/option&gt;
    &lt;option value ="Physics"&gt;Physics&lt;/option&gt;
    &lt;option value ="History"&gt;History&lt;/option&gt;
  &lt;/select&gt;&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
  &lt;td style="text-align:center" colspan="2"&gt;&lt;br /&gt;&lt;br /&gt; &lt;input src="../../images/submit1.png" name="submit" type="image"&gt; &lt;br /&gt;&lt;br /&gt; &lt;!--      If you want to remove this author link,     please purchase an unbranded version from: http://www.freecontact2form.com/unbranded_form.php       Or upgrade to the professional version at: http://www.freecontact2form.com/professional.php     --&gt; &lt;br /&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
  &lt;/table&gt;&lt;/td&gt;
  &lt;td valign="top"&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;


&lt;/tbody&gt;
&lt;/table&gt;
&lt;/form&gt; &lt;br /&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
</code></pre>

<p>This is freecontact2formprocess.php:</p>

<pre><code>if(isset($_POST['subject_type'])) {

    include 'freecontact2formsettings.php';

function died($error) {
    echo "Sorry, but there were error(s) found with the form you submitted. ";
    echo "These errors appear below.&lt;br /&gt;&lt;br /&gt;";
    echo $error."&lt;br /&gt;&lt;br /&gt;";
    echo "Please go back and fix these errors.&lt;br /&gt;&lt;br /&gt;";
    die();
}

if(!isset($_POST['subject_type']) ||
    !isset($_POST['testvariablealwaysset']) ||


    ) {
    died('Sorry, there appears to be a problem with your form submission.');        
}

$subjecttype_from = $_POST['subject_type']; // required









$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($email_to, $email_subject, $email_message, $headers);
header("Location: $thankyou");
?&gt;
&lt;script&gt;location.replace('&lt;?php echo $thankyou;?&gt;')&lt;/script&gt;
&lt;?php
}
die();
?&gt;
</code></pre>

<p>this is freecontact2formsettings:</p>

<pre><code>&lt;?php

$email_to = "myemailaddress@emailaddress.com"; // your email address
$email_subject = "Subject type"; // email subject line


if ($subjecttype_from="Maths")
{
$thankyou = "http://www.google.com";
}
else
{
$thankyou = "http://www.yahoo.com"; // thank you page
}

// if you update the question on the form -
// you need to update the questions answer below
$antispam_answer = "25";

?&gt;
</code></pre>

<p>On the freecontact2formsetting file, i have set a condition that if the user selects Maths from the drop down menu, the thank you page is set to google.com, if however anything else is selected it goes to yahoo.com. Currently all redirects are going to google.com regardless, how do i make sure when the user selects anything but maths, it goes to yahoo.com?</p>
