hi I have a html form with a select, this select the options do not have the actual value to avoid sql injections. form html
<select type="text" name="code">
<option value="1">domain3.net</option>
<option value="2">domain2.com</option>
<option value="3">domain.es</option>
</select>
I am getting correctly all the variables, only that I wish that now this value of the select is transformed into the actual value is a domain tld, which is located in a static array. my php
$dor = $_POST['code'];
$dom = array(
1 => 'domain3.net',
2 => 'domain2.com',
3 => 'domain.es'
);
$domain = (in_array($dor, $dom));
echo $domain;
I hope you can help me
$dorwill be the key for your array:$domain = $dom[$dor];if(isset($dom[$dor])) echo $dom[$dor];