<label class='colwidth' for='selectc' >Select Courses*: </label>
<form action="send.php" name="course" id="states"method="post">
<Select name="States" id="State" style="width:40px;" >
<option value=></option>
<option value="1">HTML 5</option>
<option value="2">JQuery</option>
<option value="android">American Samoa</option>
<option value="flash">Flash</option>
<option value="flex">Flex</option>
<option value="javascript">Javascript</option>
</Select>
<input type='submit' name='course' value='Submit' />
</form>
And my php file is this
<?php
//Place state array at the top of the file
$states = array(
1 => "html5",
2 => "jquery",
3 => "android",
4 => "flash",
5 => "flex",
6 => "javascript"
);
//Generate select box
if(!is_array($states)) {
echo "<select name='states' id='states' style='width:40px'>";
foreach($states as $id => $name) {
echo "<option value='$id'>$name</option>";
}
echo "</select>";
}
//Form POSTed
if(is_array($_POST)) {
//Send email message
$email = "State: ".$states[$_POST['state']];
//Do email sending or message displaying
//Submit to datebase
//$query = "INSERT INTO table ('state') VALUES ('".mysqli_escape_string($_POST['state'])."')";
//Do insert into mysql
}
?>