I am trying to create a form for a campaign for a game mod that I am helping work with, this is the sign up form. I will do my best to explain what is going on in it so that you can hopefully give me some good feedback.

Basically I have created a table that looks like this.
Code:
CREATE TABLE users(faction CHAR(6) NOT NULL, time_zone CHAR (13) NOT NULL, division1 CHAR (15) NOT NULL, division2 CHAR(15) NOT NULL, division3 CHAR (15) NOT NULL, doctrine CHAR(15) NOT NULL, name CHAR(16) NOT NULL, PRIMARY KEY (name);
So on this form they enter a name they want used for their profile, they select a faction type (axis or allies) and then in each faction there are 3 doctrines to choose from. Once they choose the faction/doctrine then they select their choice of doctrine. There are 6 divisions for each faction.

I have it so that all of the selecting will be done using arrays and drop down menu's. and then at the end sending all the data to the table.

One part I havent got programmed yet is that it will take the information they entered and then limit what division they are able to get into based on the number of doctrines in that division already. I am having a hard time figuring out how I am going to do that, will probably be a require_once to process the information after it has been sent to the table. I will then have to be able to query what members (by $name) are in there and send it to a seperate html window displayed on the front of our website.

Main Code
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
	<title>TLS Sign up Form</title>
</head>
<body>
<?php # TLS signup_form.php
<form name="TLSsignup" method="post" action="<?php echo $PHP_SELF; ?>">;

//Get the mysql connect script
require_once('mysqli_connect.php');

// Create a shorthand for the form data:
$name = $_POST['name'];
$faction = $_POST['faction'];
$allies_doctrines = $_POST['allies_doctrines'];
$axis_doctrines = $_POST['axis_doctrines'];
$allies_divisions = $_POST['allies_divisions'];
$axis_divisions = $_POST['axis_divisions'];
$time_zone = $_POST[time_zone'];

//Generate the arrays needed.
$allies_doctrines = array (1 => 'infantry','airborne','armor');
$axis_doctrines = array (1 => 'terror','blitzkrieg','defense');
$allies_divisions = array (1 => '1st_infantry','82nd_airborne','3rd_armored','101st_airborne','3rd_infantry','6th_armored');
$axis_divisions = array (1 => '84th_infanterie','16th_ss_panzer','21st_panzer','352nd_infanterie','2nd_panzer','1st_ss_panzer');
$time_zone = array (1 => 'north_america','europe');
$faction = (1 => 'allies','axis');

//Get profile name
$name = <input type = "text" size= "12" maxlength="16" name= "name"><br/>

//Select your faction, create the faction drop down menu.
echo ('Choose your Faction');
   echo '<select name = "faction">'
      foreach ($faction as $key => $value {
         echo ", option value =\$key\"> $value </option>\n";
}
   echo '</select>;

$faction = $value;

if ($faction($_POST[faction]=="allies")) {
echo ('Choose your doctrine');
   echo '<select name = "allies_doctrines">'
      foreach ($allies_doctrines as $key => $value {
         echo ", option value =\$key\"> $value </option>\n;
}
   echo '</select>';
$doctrine=$value ;
//choose your division for allies.  3 arrays for 3 different choices. Each choice kept as a seperate record for later use.
//first choice
    echo ('Choose your top 3 Division choices');
       echo '<select name = "allies_divisions">'
          foreach ($allies_divisions as $key => $value {
		 echo ", option value =\$key\"> $value </option>\n;
}
   echo '</select>';
$choice1 = $value;
//second choice
       echo '<select name = "allies_divisions">'
          foreach ($allies_divisions as $key => $value {
		 echo ", option value =\$key\"> $value </option>\n;
}
   echo '</select>';
$choice2 = $value;
//third choice
       echo '<select name = "allies_divisions">'
          foreach ($allies_divisions as $key => $value {
		 echo ", option value =\$key\"> $value </option>\n;
}
   echo '</select>';
$choice3 = $value;
     
}else {
//choose your division for axis.  3 arrays for 3 different choices. Each choice kept as a seperate record for later use.
//first choice
    echo ('Choose your top 3 Division choices');
       echo '<select name = "axis_divisions">'
          foreach ($axis_divisions as $key => $value {
		 echo ", option value =\$key\"> $value </option>\n;
}
   echo '</select>';
$choice1 = $value;
//second choice
       echo '<select name = "axis_divisions">'
          foreach ($axis_divisions as $key => $value {
		 echo ", option value =\$key\"> $value </option>\n;
}
   echo '</select>';
$choice2 = $value;
//third choice
       echo '<select name = "axis_divisions">'
          foreach ($axis_divisions as $key => $value {
		 echo ", option value =\$key\"> $value </option>\n;
}
   echo '</select>';
$choice3 = $value;
}
//Get the time zone
echo ('Please select your time zone.');
   echo '<select name ="time_zone">'
	foreach ($time_zone as $key => $value {
	   echo ", option value =\$key\"> $value </option>\n;
}
	echo '</select>';
$time_zone=$value;

//Instert the data entered into the database.
$q = "INSERT INTO users (faction, time_zone, division, doctrine, name) VALUES ('$faction','$time_zone','$choice1','$choice2','$choice3','$doctrine','$name')";
$r = @mysqli_query($dbc, $q);
//check to make sure that the data was sent to the database.
if ($r) {
	echo '<h1> Thank You</h1>
		<p>You have been registered for The Last Stand</p><p><br />
		</p>
	  }
else    {
	echo '<h1>Error</h1>
		<p class ="error"> There was an error in the system, we apologize; please go back and register again.</p>';
	echo '<p>'.mysqli_error($dbc).<br/>Query:'.$q.'</p>';
	  }

?>
</body>
</html>


If you guys could help me with the code, look it over and see if I made any mistakes or where I can optimize it better, I would greatly appreciate it. I have to have this up and running by Saturday