hey ppl i have form select like this
<select name='anythingwho'> <option value='1'>test1</option> <option value='2'>test2</option> <option value='3'>test3</option> </select>
and now when i check one of those how i get this php like variable ?
Well, when the form is submitted then the selected value will be assigned to $POST['anythingwho'] ( or $GET['anythingwho'] if you're using the get method ).
so if i add like this 1,2,3 it work with form values ? $anything[1] = "test-mail@127.0.0.1"; $anything[2] = "test2@127.0.0.1"; $anything[3] = "test3@127.0.0.1";
The value is whatever is in the option value that is selected when the form is submitted...
<form name="form1" method="post" action="<?=$PHP_SELF?>"> <select name='anythingwho'> <option value='test-mail@127.0.0.1'>test1</option> <option value='test2@127.0.0.1'>test2</option> <option value='test3@127.0.0.1'>test3</option> </select> <input type="submit" name="Submit" value="Submit"> </form> <? if(isset($anythingwho)){ print("$anythingwho"); } ?>