I want to charge a customer in a simple one page script, but for some reason it just give me the form over and over and does not modify the DB. HEre is my code. Thanks for anyone's help in advance.
<? session_start();
$username = $_SESSION['username@spechal.com'];
if(!isset($_SESSION['username@spechal.com'])){
echo "<font face='Tahoma' size='2'><b><center>Error! <br><br>
Either you chose not to accept the cookie or your browser is set to reject cookies and/or sessions.
</b></font>";
exit();
} else {
if(isset($_POST['submit'])){
$wage = 55;
$hours = $_POST['hours'];
$coname = $_POST['coname'];
$balance = ($wage*$hours);
$approved = $_POST['approved'];
$q = mysql_query("UPDATE customers SET balance='$balance', work='$work', hours='$hours', approved='$approved' WHERE coname='$coname'") or die(mysql_error());
echo "$coname was charged $balance";
}
include('css.php');
include('adminmenu.php');
include('dbinfo.inc.php');
?>
<form enctype="multipart/form-data" method="post" action="<?=$PHP_SELF?>">
<table width="85%" border="0">
<tr>
<td width="35%"><font size="3" face="Tahoma">Wage:</font></td>
<td width="65%">$55 per hour</td>
</tr>
<tr>
<td><font size="3" face="Tahoma">Work Preformed:</font></td>
<td><input name="work" type="text" id="work" size="24" maxlength="200"> </td>
</tr>
<tr>
<td><font size="3" face="Tahoma">Worked For:</font></td>
<td><input name="coname" type="text" id="coname" size="24" maxlength="24"> </td>
</tr>
<tr>
<td><font size="3" face="Tahoma">Hours Worked:</font></td>
<td><input name="hours" type="text" id="hours" size="24" maxlength="24"> </td>
</tr>
<tr>
<td><font size="3" face="Tahoma">Approved By:</font></td>
<td><input name="approved" type="text" id="approved" size="24" maxlength="24"> </td>
</tr>
<tr>
<td><input type="image" src="images/submit.jpg" value="submit">
</td>
<td> </td>
</tr>
</table>
</form>
</body>
</html>
<? } ?>