Hi Forum,
Sorry - newbie question😃
I have inherited an Online Order System which is less than optimal.
If a new item is to be added, I have to add data to 4 different php scripts.
I have created a database which reads an excel file for updates and managed to rewrite the first page, but this page which checks the qty ordered on the calling-form is giving me problems!
Below is what I inherited and as you can see it is hard-coded and is one of the scripts I have to edit when a new item is to be sold.
I want to rewrite it so it pulls it's data from the DB using a loop, how can I achieve this?
Thanks for your time and consideration...... Nick
<?
include ("db.php");
echo "
<html>
<head>
<title>Online Order System</title>
</head>
<body link=#000000 alink=#000000 vlink=#000000><form action=order.php method=post>
<div align=\"right\"><img src=\"images/logo.gif\"></div>";
if (($a1200==0) && ($a1222==0) && ($a1235==0) && ($a1280==0) && ($a1290==0) && ($a1295==0) && ($a1300==0) &&
($a1310==0) && ($a1311==0) && ($a1315==0) && ($a1285==0) && ($a1284==0) && ($a1286==0) && ($a1287==0) &&
($a1289==0) && ($a1288==0) && ($a1035==0) && ($a1045==0) && ($a1043==0) && ($a1041==0) && ($a1031==0) &&
($a1032==0) && ($a1033==0) && ($a1021==0) && ($a1022==0) && ($a1023==0) && ($a1026==0) && ($a1011==0) &&
($a1012==0) && ($a1013==0) && ($a1014==0) && ($a1063==0) && ($a1069==0) && ($a1074==0) && ($a1076==0) &&
($a1075==0) && ($a1073==0) && ($a1038==0) && ($a1039==0) && ($a1040==0) && ($a1053==0) && ($a1320==0) &&
($a1250==0) && ($a1251==0) && ($a1034==0) && ($a1015==0) && ($a1016==0) && ($a1017==0) && ($a1065==0) &&
($a1052==0))
{
echo "<br><br><br><br><br><div align=center><font face=Arial size=4><b>You have not ordered anything!. <br><br>Please check your input.<br><br><a href=\"OrderForm.php\">Back</a></b></font></div>";
}
else {
echo "
<font face=Arial size=4><b>Please check your Order:</b></font><br><br><br><br>
<div align=center><table cellspacing=0 cellpadding=0 width=80%>
<tr>
<td height=30><div align=center><font face=Arial><b>Art. No.</b></font></div></td>
<td height=30><font face=Arial><b>Description</b></font></td>
<td height=30><font face=Arial><b>Pack Qty</b></font></td>
<td height=30><div align=center><font face=Arial><b>Qty</b></font></div></td>
</tr><tr></tr><tr></tr><tr></tr><tr></tr>";
if ($a1200>0) {
echo "
<tr>
<td><div align=center><font face=Arial>1200</font></div></td>
<td><font face=Arial>$B1200</font></td>
<td><font face=Arial>1 Pieceá 2m</font></td>
<td><div align=center><font face=Arial><input type=text SIZE=3 name=a1200 value=$a1200></font></div></td>
</tr><tr></tr><tr></tr>";
}
if ($a1222>0) {
echo "
<tr>
<td><div align=center><font face=Arial>1222</font></div></td>
<td><font face=Arial>$B1222</font></td>
<td><font face=Arial>1 Piece</font></td>
<td><div align=center><font face=Arial><input type=text SIZE=3 name=a1222 value=$a1222></font></div></td>
</tr><tr></tr><tr></tr>";
}
etc.