我有一个包含表单的 HTML 页面。然后表单发布到 PHP 页面,在该页面向用户发送电子邮件。我有一个值为 1-58 的“状态”下拉框(我的数据库需要这些)。有没有办法在发送电子邮件时获取州名而不是数字值?
我的 HTML:
<Select name="State" id="State" style="width:40px;" >
<option value="17"></option>
<option value="18">Alabama</option>
<option value="19">Alaska</option>
<option value="20">American Samoa</option>
<option value="21">Arizona</option>
<option value="22">Arkansas</option>
<option value="15">California</option>
<option value="6">Canada</option>
<option value="11">Colorado</option>
<option value="23">Connecticut</option>
<option value="24">Delaware</option>
<option value="25">District Of Columbia</option>
<option value="26">Federated States Of Micronesia</option>
<option value="7">Florida</option>
<option value="27">Georgia</option>
<option value="28">Guam</option>
<option value="29">Hawaii</option>
<option value="30">Idaho</option>
<option value="8">Illinois</option>
<option value="14">Indiana</option>
<option value="31">Iowa</option>
<option value="32">Kansas</option>
<option value="33">Kentucky</option>
<option value="34">Louisiana</option>
<option value="35">Maine</option>
<option value="36">Marshall Islands</option>
<option value="37">Maryland</option>
<option value="38">Massachusetts</option>
<option value="1">Michigan</option>
<option value="5">Minnesota</option>
<option value="39">Mississippi</option>
<option value="40">Missouri</option>
<option value="41">Montana</option>
<option value="42">Nebraska</option>
<option value="43">Nevada</option>
<option value="44">New Hampshire</option>
<option value="12">New Jersey</option>
<option value="45">New Mexico</option>
<option value="46">New York</option>
<option value="13">North Carolina</option>
<option value="47">North Dakota</option>
<option value="4">Ohio</option>
<option value="48">Oklahoma</option>
<option value="49">Oregon</option>
<option value="10">Pennsylvania</option>
<option value="50">Rhode Island</option>
<option value="51">South Carolina</option>
<option value="52">South Dakota</option>
<option value="53">Tennessee</option>
<option value="2">Texas</option>
<option value="54">Utah</option>
<option value="55">Vermont</option>
<option value="3">Virginia</option>
<option value="56">Washington</option>
<option value="57">West Virginia</option>
<option value="9">Wisconsin</option>
<option value="58">Wyoming</option>
</Select>
当前 PHP$message
行:
"\nState: " . stripslashes($_POST["State"]) .
我收到的电子邮件说"State: 1"
的是"State: Michigan".
谢谢。