I'm not sure if I follow you, but I think as long as you pass the variable to the script and define it before you use it in a function, you should be okay...no?
I.e. user picks form choice from page, form element is named "id"
<form action=thescript.php method=post>
<select name=id size=1>
<option value=1>1
<option value=2>2
<option value=3>3
<option value=4>4
(etc.)
</select>
</input type=submit>
</form>
Then "thescript.php" just has to have a line near the top like:
$id = $_POST['id'];
Then call your function...
$result = $myfunction($id); // or whatever.
Hope that helps...if not, tell us more about what you're trying to do.
-- Nully