Very sorry about this bad news, but, your sample code is incorrect in so many places,
I don’t know how to explain it. First, several code groups starting with a ‘{’ do not end… I have told you this, but, you can’t seem to see it.
Let’s try one more time… If you have this code:
<?PHP (Start PHP)
if(...){
echo "xyz";
echo "123";
?> (End PHP)
<SELECT …> (and then have html), then the code never ends. The “if” will execute the xyz-echo and end. It never makes it to further code later on. Then, you have more php code and eventually close the group, but, it never really closes. So a lot of your code never get’s executed.
Usually, you would do this this way:
<?PHP
if(...){
echo "xyz";
echo "123";
echo "/n";
}
?>
You see the HTML is printed BY YOUR PHP and ALL your code get’s executed…
Also, You have a form set up, but, it is NOT in the body of the html page. As far as I know a form will not post without it being inside the body of the html page. And, lastly you can not mix up javascript and php the way you are doing it. You may be getting it to do some sort of refresh, but, who knows what routines are being called.
To prove this, when you open this page from the internet, RIGHT-CLICK on it and select VIEW-SOURCE. Then, look at this code and see what you actually have as a posted page OUT OF your PHP page. You will see no PHP code in it. (Unless a javascript routine stored some there, but, it is not executable that way!)
So, this means you should start over with a standard form and standard PHP routine and get that to work first. Then, bring in some of your Javascript or Jquery and change things little by little…
Sorry for all that disappointing news…