Code: Select all
<?php
}ELSEIF($_GET[a] != "logout" OR $_GET[a] != "verify" OR $_GET[a] != "post"){
mysql_connect("localhost","$username","$password") or die ("Unable to connect to MySQL server.");
$db = mysql_select_db("$database") or die ("Unable to select requested database.");
$query="SELECT * FROM teachers ORDER BY id ASC";
$result=mysql_query($query);
$num=mysql_num_rows($result);
mysql_close();
$i=0;
while ($i < $num) {
$teachers=mysql_result($result,$i,"username");
$main = "<form method='POST' action='delete.php?a=verify'>
<table border='0' width='100%' cellspacing='0' cellpadding='0' id='table10'>
<tr>
<td align='right' width='100%' colspan='2'>
<p align='center'>$error</td>
</tr>
<tr>
<td align='center' width='100%' colspan='2'>
<b><font size='2'>*NOTE*: Don't abuse this power...</font></b></td>
</tr>
<tr>
<td height='10'>
</td>
</tr>
<tr>
<td align='right' width='50%' valign='top'>
<p align='right'><b>Your Name:</b></td>
<td align='left' width='50%'>$_COOKIE[username]<br>
<font size='2'>(To login under a different username, </font> <a href='http://www.*****.com/login.php?a=logout'>
<font size='2'>click here.)</font></a></td>
</tr>
<tr>
<td align='right' width='50%'><b>Teacher that will be deleted:</b></td>
<td width='50%' align='left'>
<select name='filter_teachers'>
<option value='showall'>Choose a Teacher</option>
<option>----------------------</option>
<option value='$teachers'>$teachers</option>
$i++;
}
</select>
</td>
</tr>
<tr>
<td align='right' width='50%'> </td>
<td align='left' width='50%'> </td>
</tr>
</table>
<p>
<input type='submit' value='Proceed' name='submit' tabindex='3' style='font-weight: bold; border-style: dashed; border-width: 1px; background-color: #999999'></p>
</form>";
}
?>