Here's my form code.
What am I doing wrong???
This is the form:
<?
include "db_connect.php"; //connecting to MySQL server and DB
if (isset($POST["submit"])) //if the form was submitted
{
$barcode1=$POST["barcode1"];
$barcode2=$POST["barcode2"];
$barcode3=$POST["barcode3"];
$barcode4=$_POST["barcode4"];
}
if (!isset($POST["submit"])) //if the "button" is unset
{
//printing the form:
?>
<FORM action="print.php" method="POST">
<TABLE border=0 cellpadding=3 cellspacing=3>
<TR>
<TD>barcode1</TD>
<TD><INPUT type="TEXT" name="barcode1" size=15 maxlength=9 value="<?= $POST["barcode1"]; ?>"></TD>
</TR>
<TR>
<TD>barcode2</TD>
<TD><INPUT type="TEXT" name="barcode2" size=5 maxlength=8 value="<?= $POST["barcode2"]; ?>"></TD>
</TR>
<TR>
<TD>barcode3</TD>
<TD><INPUT type="TEXT" name="barcode3" size=5 maxlength=8 value="<?= $POST["barcode3"]; ?>"></TD>
</TR>
<TR>
<TD>barcode4</TD>
<TD><INPUT type="TEXT" name="barcode4" size=5 maxlength=8 value="<?= $_POST["barcode4"]; ?>"></TD>
</TR>
<TR>
<TD align="right"><INPUT type="SUBMIT" name="submit" value="send"></TD>
<TD align="left"><INPUT type="RESET" value="reset"></TD>
</TR>
</TABLE>
</FORM>
<?
}
?>
and this id the print.php
<?php
include "db_connect.php"; //connecting to MySQL server and DB
$sql = "SELECT price
FROM classics WHERE barcode = " + $_POST['barcode1'];
$res = mysql_query($sql);
$total = 0;
while($row=mysql_fetch_array($res)) {
$total += $row['price'];
}
echo "$barcode1"<br>
echo "$barcode2"<br>
echo "$barcode3"<br>
echo "$barcode4"<br>
echo "$total"
?>
nothing is showing up.
<?Help?>