i want this to be happen defult color of seats i mean available color of seats to be green after that if a user book a ticket it goes to red and stays red how can i do this?

code im using

<?php

$connection = mysql_connect("localhost","root","password") or die("error connect");
mysql_select_db("online_bus_project");



if(isset($_POST['team']))

{

header("location: http://localhost/site/ticketregistration.php");

foreach($_POST['team'] as $value) {

$insert="INSERT INTO seat (seat) VALUES ('$value')";

mysql_query($insert);

}

}

?>

HTML FORM:

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
   
        
  <table width="94%" bgcolor="#cacb98" border="1" cellpadding="0" cellspacing="0">
    <tbody><tr> 
            <td width="12%">  
              <input name="team[]" value="1" type="checkbox">
              <font size="2" face="verdana">1</font>  </td>
            <td width="12%">  
              <input name="team[]" value="2" type="checkbox">
              <font size="2" face="verdana">2</font>  </td>
            <td width="13%">  
              <input name="team[]" value="3" type="checkbox">
              <font size="2" face="verdana">3</font>  </td>
            <td width="13%">  
              <input name="team[]" value="4" type="checkbox">
              <font size="2" face="verdana">4</font>  
            </td>
            <td width="20%">  
              <input name="team[]" value="5" type="checkbox">
              <font size="2" face="verdana">5</font>  </td>
          </tr>
          <tr> 
            <td width="12%">  
              <input name="team[]" value="6" type="checkbox">
              <font size="2" face="verdana">6</font>  </td>
            <td width="12%">  
              <input name="team[]" value="7" type="checkbox">
              <font size="2" face="verdana">7</font>  </td>
            <td width="13%">  
              <input name="team[]" value="8" type="checkbox">
              <font size="2" face="verdana">8</font>  </td>
            <td width="13%">  
              <input name="team[]" value="9" type="checkbox">
              <font size="2" face="verdana">9</font>  </td>
            <td width="20%">  
              <input name="team[]" value="10" type="checkbox">
              <font size="2" face="verdana">10</font>  </td>
          </tr>
          <tr> 
            <td width="12%">  
              <input name="team[]" value="11" type="checkbox">
              <font size="2" face="verdana">11</font>  </td>
            <td width="12%">  
              <input name="team[]" value="12" type="checkbox">
              <font size="2" face="verdana">12</font>  </td>
            <td width="13%">  
              <input name="team[]" value="13" type="checkbox">
              <font size="2" face="verdana">13</font>  </td>
            <td width="13%">  
              <input name="team[]" value="14" type="checkbox">
              <font size="2" face="verdana">14</font>  </td>
            <td width="20%">  
              <input name="team[]" value="15" type="checkbox">
              <font size="2" face="verdana">15</font>  </td>
          </tr>
          <tr> 
            <td width="12%">  
              <input name="team[]" value="16" type="checkbox">
              <font size="2" face="verdana">16</font>  </td>
            <td width="12%">  
              <input name="team[]" value="17" type="checkbox">
              <font size="2" face="verdana">17</font>  </td>
            <td width="13%">  
              <input name="team[]" value="18" type="checkbox">
              <font size="2" face="verdana">18</font>  </td>
            <td width="13%">  
              <input name="team[]" value="19" type="checkbox">
              <font size="2" face="verdana">19</font>  </td>
            <td width="20%">  
              <input name="team[]" value="20" type="checkbox">
              <font size="2" face="verdana">20</font>  </td>
          </tr>
          <tr> 
            <td width="12%">  
              <input name="team[]" value="21" type="checkbox">
              <font size="2" face="verdana">21</font>  </td>
            <td width="12%">  
              <input name="team[]" value="22" type="checkbox">
              <font size="2" face="verdana">22</font>  </td>
            <td width="13%">  
              <input name="team[]" value="23" type="checkbox">
              <font size="2" face="verdana">23</font>  </td>
            <td width="13%">  
              <input name="team[]" value="24" type="checkbox">
              <font size="2" face="verdana">24</font>  </td>
            <td width="20%">  
              <input name="team[]" value="25" type="checkbox">
              <font size="2" face="verdana">25</font>  </td>
          </tr>
          <tr> 
            <td width="12%">  
              <input name="team[]" value="26" type="checkbox">
              <font size="2" face="verdana">26</font>  </td>
            <td width="12%">  
              <input name="team[]" value="27" type="checkbox">
              <font size="2" face="verdana">27</font>  </td>
            <td width="13%">  
              <input name="team[]" value="28" type="checkbox">
              <font size="2" face="verdana">28</font>  </td>
            <td width="13%">  
              <input name="team[]" value="29" type="checkbox">
              <font size="2" face="verdana">29</font>  </td>
            <td width="20%">  
              <input name="team[]" value="30" type="checkbox">
              <font size="2" face="verdana">30</font>  </td>
          </tr>
    <tr>
            <td width="12%">  
              <input name="team[]" value="31" type="checkbox">
              <font size="2" face="verdana">31</font>  </td>
            <td width="12%">  
              <input name="team[]" value="32" type="checkbox"> <font size="2" face="verdana">32</font>
               </td>
            <td width="13%">  
              <input name="team[]" value="33" type="checkbox"> <font size="2" face="verdana">33</font>
               </td>
            <td width="13%">  
              <input name="team[]" value="34" type="checkbox"> <font size="2" face="verdana">34</font>
               
            </td>
            <td width="20%">  
              <input name="team[]" value="35" type="checkbox"> <font size="2" face="verdana">35</font>
               </td>
    </tr>
    <tr>
            <td width="12%">  
              <input name="team[]" value="36" type="checkbox">
              <font size="2" face="verdana">36</font>  </td>
            <td width="12%">  
              <input name="team[]" value="37" type="checkbox">
              <font size="2" face="verdana">37</font>  </td>
            <td width="13%">  
              <input name="team[]" value="38" type="checkbox">
              <font size="2" face="verdana">38</font>  </td>
            <td width="13%">  
              <input name="team[]" value="39" type="checkbox">
              <font size="2" face="verdana">39</font>  </td>
            <td width="20%">  
              <input name="team[]" value="40" type="checkbox"> <font size="2" face="verdana">40</font>
               </td>
    </tr>
          <tr> 
            <td width="12%">  
              <input name="team[]" value="41" type="checkbox"> <font size="2" face="verdana">41</font>
               </td>
            <td width="12%">&nbsp;  </td>
            <td width="13%">&nbsp;  </td>
            <td width="13%">&nbsp;  </td>
            <td width="20%">  </td>
          </tr>
        </tbody></table>
  <p align="center">&nbsp;</p>
  <p></p><table>
      <tbody><tr>
      <td>
        
      <div align="center"><input type="submit" name="submit" value="submit">
</div></td>
    </tr>

how can i do this havent done it before?

here some code:

if ($status == 0) {
		$seatColor = "lightgreen";
	} 


else {
		$seatColor = "red";
	}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.