Any ideas on why the value for $user is not getting inserted into my database table? Everything else makes it in OK, and I can echo the value on the form, so I know it's populated correctly. I think I'm just missing something small.
Thanks!
Passing : weight?user=Mark
<?php
$HTTP_GET_VARS['user'];
if ($submit) {
$db = mysql_connect("localhost", "xxxxx", "xxxxx");
mysql_select_db("fitness",$db);
$bmi = ($weight/(5476))*703;
$sql = "INSERT INTO weight (user,date,weight,bmi,location) VALUES ('$user','$date','$weight','$bmi','$location')";
$result = mysql_query($sql);
header ("Location: http://www.somewhere.com/");
} else {
?>
<html>
<head>
<title>Weight Input</title>
</head>
<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" bgcolor="#FFFFFF">
<!-- Start Submission Form -->
<TABLE BORDER=0 CELLSPACING=2 CELLPADDING=2>
<FORM METHOD="post" ACTION="<?php echo $PHP_SELF?>">
<tr>
<td ColSpan=1 RowSpan=1 Align=Left>
Name:
</td>
<td ColSpan=1 RowSpan=1 Align=Left>
<?php
echo $user;
?>
</td>
</tr>
<tr>
<td ColSpan=1 RowSpan=1 Align=Left>
Date:
</td>
<td ColSpan=1 RowSpan=1 Align=Left>
<INPUT TYPE="text" NAME="date" SIZE=10>
</td>
</tr>
<tr>
<td ColSpan=1 RowSpan=1 Align=Left>
Weight:
</td>
<td ColSpan=1 RowSpan=1 Align=Left>
<INPUT TYPE="text" NAME="weight" SIZE=10>
</td>
</tr>
<tr>
<td ColSpan=1 RowSpan=1 Align=Left>
Location : <select name="location">
<option selected> Home
<option> Office
<option> Doctor
</select>
</td>
</tr>
<tr>
<td ColSpan=2 RowSpan=1 Align=Center>
<INPUT TYPE="submit" NAME="submit" VALUE="Submit"> <INPUT TYPE="reset" VALUE="Reset">
</td>
</tr>
</FORM>
</TABLE>
<!-- End Submission Form -->
<?php
} // end if
?>
</body>
</html>