I'd create an array that held the Change value (0 [false] or 1 [true]) for each. Then I'd make a loop that just set up the table with an if statement: "if ($Change[$count]) { echo $bg; }". $Change[0] would correspond with ph1, unless you started the array(1 => ...).
"Peter" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > howdy all > > my aim is to have a user submit a form and then from there replace cell colours with in a table. I'm referencing the cells by cell id's eg > > <tr> > <td height="10" bgcolor=<? echo $bg; ?> id="ph1"><font size="-2" face="Arial, Helvetica, sans-serif">1</font> > </td> > <td height="10" bgcolor=<? echo $bg; ?> id="ph2"><font size="-2" face="Arial, Helvetica, sans-serif">2</font> > </td> > <td height="10" bgcolor=<? echo $bg; ?> id="ph3"><font size="-2" face="Arial, Helvetica, sans-serif">3</font> > </td> > <td height="10" bgcolor=<? echo $bg; ?> id="ph4"><font size="-2" face="Arial, Helvetica, sans-serif">4</font> > </td> > </tr> > > now using a switch statement eg > > switch( $bg ) > { > case "red": > print( "#FF0000" ); > break; > //a few more colours in here > default: > print( "#FFFFFF" ); > break; > } > what would be the best way to tell it what cell colours to replace on submit would it be an if, for or a do/while statement that would be the better option ( or any others that 4 that matter) if i wanted to have just the cells with the ids of ph2 & ph3 to be changed? > > > Cheers > > Peter > "the only dumb question is the one that wasn't asked" > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php