you're mixing up the serverside with clientside here...
when you first request the form, there is no POST data, and so $s is initialised to null (actually, you should be seeing an error about an undefined index if you have STRICT error messages set)
so, the form action is set to '' - which is wrong, as you can see...
You could use a javascript to do this:
HTML Code:
<script type="text/javascript">
function submit_form()
{
var file_select = document.getElementById('file_select');
if (file_select.selectedIndex > -1) {
var test_form = document.getElementById('dropdown_test_form');
test_form.action = file_select.options[file_select.selectedIndex].value;
test_form.submit();
}
}
</script>
<form id="dropdown_test_form" method="post" action="option1.html">
<select name="option" id="file_select">
<option value="option1.html">
Option1
</option>
<option value="option2.html">
Option2
</option>
</select>
</form>