This was working an hour ago... now it's all whacked- it won't error out, but it isn't inserting the record into the database either, and I cannot figure out why... I did everything by the book, and the code is very clean and structured. Here's the source code:
<html>
<body>
<?php
if ($submit) {
// Connect to DataBase
$link = mysql_connect("localhost", "myname", "mypass" or die("Could not connect : " . mysql_error());
print "Connected successfully";
mysql_select_db("sales" or die("Could not select database"
//Process Form
$sid = $_POST["sid"];
$cid = $_POST["cid"];
$ctn = $_POST["ctn"];
$dot = $_POST["dot"];
$pmtt = $_POST["pmtt"];
$pamt = $_POST["pamt"];
$sql = "INSERT INTO customer (sales_id, customer_id, tn, user_date, paytype, payamount) VALUES ('$sid','$cid','$ctn','$dot', '$pmtt', '$pamt')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
} // end if
?>
<form method="post" action="<?php echo $PHP_SELF?>">
<center>
<TABLE>
<TR>
<TD>Sales ID</TD>
<TD>Customer ID</TD>
<TD>Telephone Number (no dashes)</TD>
<TD>Date Entered (yyyy-mm-dd)</TD>
</TR>
<TR>
<TD><input type="text" name="sid" maxlength="4"></TD>
<TD><input type="text" name="cid" maxlength="6"></TD>
<TD><input type="text" name="ctn" maxlength="10"></TD>
<TD><input type="text" name="dot" maxlength="10"></TD>
</TR>
<TR>
<TD> </TD>
<TD>Payment Type</TD>
<TD>Payment Amount</TD>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
<TD><input type="text" name="pmtt" maxlength="15"></TD>
<TD><input type="text" name="pamt" maxlength="6"></TD>
<TD> </TD>
</TR>
<TR><td colspan="4" align="center"><input type="submit" name="submit" value="Submit Sale"></TD></TR>
</table>
</form>
<A href="insertmatrix.php">Reload Page</a>
</body>
</html>
<html>
<body>
<?php
if ($submit) {
// Connect to DataBase
$link = mysql_connect("localhost", "myname", "mypass" or die("Could not connect : " . mysql_error());
print "Connected successfully";
mysql_select_db("sales" or die("Could not select database"
//Process Form
$sid = $_POST["sid"];
$cid = $_POST["cid"];
$ctn = $_POST["ctn"];
$dot = $_POST["dot"];
$pmtt = $_POST["pmtt"];
$pamt = $_POST["pamt"];
$sql = "INSERT INTO customer (sales_id, customer_id, tn, user_date, paytype, payamount) VALUES ('$sid','$cid','$ctn','$dot', '$pmtt', '$pamt')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
} // end if
?>
<form method="post" action="<?php echo $PHP_SELF?>">
<center>
<TABLE>
<TR>
<TD>Sales ID</TD>
<TD>Customer ID</TD>
<TD>Telephone Number (no dashes)</TD>
<TD>Date Entered (yyyy-mm-dd)</TD>
</TR>
<TR>
<TD><input type="text" name="sid" maxlength="4"></TD>
<TD><input type="text" name="cid" maxlength="6"></TD>
<TD><input type="text" name="ctn" maxlength="10"></TD>
<TD><input type="text" name="dot" maxlength="10"></TD>
</TR>
<TR>
<TD> </TD>
<TD>Payment Type</TD>
<TD>Payment Amount</TD>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
<TD><input type="text" name="pmtt" maxlength="15"></TD>
<TD><input type="text" name="pamt" maxlength="6"></TD>
<TD> </TD>
</TR>
<TR><td colspan="4" align="center"><input type="submit" name="submit" value="Submit Sale"></TD></TR>
</table>
</form>
<A href="insertmatrix.php">Reload Page</a>
</body>
</html>