I've got this SELECT in an HTML form (multipart/form-data) passing on a value called agemail:
<select name="agemail" class="bodyText" id="agemail">
<option value="toby@example.com" selected>Toby Piper</option>
<option value="linda@example.com">Linda Terry</option>
<option value="shawna@example.com">Shawna Hutchins</option>
<option value="luann@example.com">Luann McCluskey</option>
<option value="bobby@example.com">Bobby Fisher</option>
<option value="joel@example.com">Joel Hamlin</option>
<option value="brian@example.com">Brian Clark</option>
</select>
Then, in the PHP on the following page, I have it doing this:
$agemail = $_POST['agemail'];
if ( substr($agemail,0,4) == "toby" ) {$agent = "Toby Piper";} else {$agent="Pecan Valley Real Estate";}
if ( substr($agemail,0,4) == "luan" ) {$agent = "Luann McCluskey";} else {$agent="Pecan Valley Real Estate";}
if ( substr($agemail,0,4) == "shaw" ) {$agent = "Shawna Hutchins";} else {$agent="Pecan Valley Real Estate";}
if ( substr($agemail,0,4) == "lind" ) {$agent = "Linda Terry";} else {$agent="Pecan Valley Real Estate";}
if ( substr($agemail,0,4) == "bobb" ) {$agent = "Bobby Fisher";} else {$agent="Pecan Valley Real Estate";}
if ( substr($agemail,0,4) == "joel" ) {$agent = "Joel Hamlin";} else {$agent="Pecan Valley Real Estate";}
if ( substr($agemail,0,4) == "bria" ) {$agent = "Brian Clark";} else {$agent="Pecan Valley Real Estate";}
before it adds both fields (agemail and agent) to the database. BUT, my AGENT field is not coming through. I get the ELSE every time!!! I'm going crazy here. Am I just leaving something out???