Quote:Original post by Third
I'll try rephrasing what I want to do. I have a function that builds a select drop down box. I want this function to return the value that the user selects.
Nope, can't happen. The PHP just builds the HTML to send to the browser. It's packed up and gone home by the time the end user even sees the form, and doesn't come into play again until they submit the form, in which case it'll come up in the $_POST variables on whatever page you submit to. PHP function can't return user input - they only ever get it from arrays like $_GET, $_POST, and $_COOKIES, which are populated before a script starts running.
I am not entirely sure what you're trying to achieve. There is hardly ever a good reason to dynamically change the 'name' of an HTML form element as you need to know what it is called in order to process it when it is submitted. Instead you will check the value associated with that name in the $_POST array in whichever file handles the submitted form, as opposed to sending the form to the user. (Although many people combine both functions into one page.)