I am looking for help to a change the colour of a cell in a table. It works if I remove if(isset($_POST['showapp'])){
but I only want it to happen when the button is clicked. Help is very much appreciated.
print '<input name="showapp" type="submit" value="Show Appointments">';
$sqlapp = "SELECT StudentID FROM timetable WHERE Username='{$_SESSION["student"]}'";
$resultapp = mysql_query($sqlapp);
if(isset($_POST['showapp'])){
if (in_array($resultapp, $myarray0)){
$colour0="yellow";
}
if (in_array($resultapp, $myarray1)){
$colour1="yellow";
}
if (in_array($resultapp, $myarray2)){
$colour2="yellow";
}
if (in_array($resultapp, $myarray3)){
$colour3="yellow";
}
if (in_array($resultapp, $myarray4)){
$colour4="yellow";
}
if (in_array($resultapp, $myarray5)){
$colour5="yellow";
}
if (in_array($resultapp, $myarray6)){
$colour6="yellow";
}
if (in_array($resultapp, $myarray7)){
$colour7="yellow";
}
}