# Php variable from selected

**URL:** <https://forum.kirupa.com/t/php-variable-from-selected/192348>\
**Category:** Uncategorized\
**Created:** [June 28, 2006, 12:11am UTC](https://forum.kirupa.com/t/php-variable-from-selected/192348 "2006-06-28T00:11:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![davez82](https://avatars.discourse-cdn.com/v4/letter/d/6bbea6/32.png) [@davez82](https://forum.kirupa.com/u/davez82)\
**Post date:** [June 28, 2006, 12:11am UTC](https://forum.kirupa.com/t/php-variable-from-selected/192348/1 "2006-06-28T00:11:22Z")

</div>

trying to do a simple change value code based on a \<select\> selection for instance

\<html\>  
\<head\>  
\</head\>  
\<body\>

\<input name=“letter” value=""\>

\<select name=“select”\>  
\<option\>a\</option\>  
\<option\>b\</option\>  
\</select\>

\</body\>  
\</html\>

if option “a” is selected, teh value for “letter” will be “A” , and if “b” will be “B”. this is for a form but using a external pearl file for the mailing so there is already values in the html , so using the $post variable probably wouldnt work in my case. I guess all i really need to know is how to make a variable out of the selects.
