hi all
i am printing out a bunch of html code with a php script and i am not sure if my html syntax or my php syntax, everything works and displays the way i want but the width tags for the text inputs don't work, anyway here is the php code that prints the html
[PHP]
$result = mysql_query("SE LECT * FROM costs");
while ($row = mysql_fetch_row ($result))
{
$final = $row[2] + $row[3];
$savings = $row[5] - $final;
echo '<tr>';
echo '<form action="process .php" method="post">' , "\n";
echo "<input type='hidden' name='id' value='$row[0]'>","\n";
echo '<td align="center" bgcolor="#dbb47 b">', $row[1], "</td>\n";
echo '<td bgcolor="#f2e1c d"> <input type="text" name="quan" width="10" value="1"></td>', "\n";
echo '<td align="center" bgcolor="#dbb47 b">$', $row[2], "</td>\n";
echo '<td align="center" bgcolor="#f2e1c d">$', $row[3], "</td>\n";
echo '<td align="center" bgcolor="#dbb47 b">$', $final, "</td>\n";
echo '<td align="center" bgcolor="#f2e1c d">$', $row[5], "</td>\n";
echo '<td align="center" bgcolor="#dbb47 b">$', $savings, "</td>\n";
echo "<td bgcolor='#f2e1c d'><input type='submit' value='Calculat e'></td>\n";
echo "</form>\n";
echo '</tr>';
}
[/PHP]
just for ease below is the html that is printed, this is coppied from the Firefox DOM inspector
[CODE=html]
<tr><form action="process .php" method="post">
<input type='hidden' name='id' value='2'>
<td align="center" bgcolor="#dbb47 b">Letter 1oz</td>
<td bgcolor="#f2e1c d"> <input type="text" name="quan" width="10" value="1"></td>
<td align="center" bgcolor="#dbb47 b">$0.312</td>
<td align="center" bgcolor="#f2e1c d">$0.078</td>
<td align="center" bgcolor="#dbb47 b">$0.39</td>
<td align="center" bgcolor="#f2e1c d">$0.41</td>
<td align="center" bgcolor="#dbb47 b">$0.02</td>
<td bgcolor='#f2e1c d'><input type='submit' value='Calculat e'></td>
</form>
</tr><tr><form action="process .php" method="post">
<input type='hidden' name='id' value='3'>
<td align="center" bgcolor="#dbb47 b">Letter 2oz</td>
<td bgcolor="#f2e1c d"> <input type="text" name="quan" width="10" value="1"></td>
<td align="center" bgcolor="#dbb47 b">$0.437</td>
<td align="center" bgcolor="#f2e1c d">$0.078</td>
<td align="center" bgcolor="#dbb47 b">$0.515</td>
<td align="center" bgcolor="#f2e1c d">$0.58</td>
<td align="center" bgcolor="#dbb47 b">$0.065</td>
<td bgcolor='#f2e1c d'><input type='submit' value='Calculat e'></td>
</form>
</tr>
[/CODE]
and above all of the php code and fancy stuff is some simple html that starts the table off with some table colom titles here is the code for that
[CODE=html]
<table align="center">
<tr align="center">
<td align="center" bgcolor="#dbb47 b">Product</td>
<td align="center" bgcolor="#f2e1c d" width="75">Quan tity</td>
<td align="center" bgcolor="#dbb47 b">Postage & <br> Handeling</td>
<td align="center" bgcolor="#f2e1c d">Postage <br> Application</td>
<td align="center" bgcolor="#dbb47 b">Final <br> Cost</td>
<td align="center" bgcolor="#f2e1c d">1st CL<br>Postal<br >Price</td>
<td align="center" bgcolor='#dbb47 b'>Savings <br> Bottom <br> Line</td>
<td> </td>
</tr>
[/CODE]
Note: this is the same table and is actualy above all that other stuff
if you would like to see the live version of this here is a link
thanks
eric
i am printing out a bunch of html code with a php script and i am not sure if my html syntax or my php syntax, everything works and displays the way i want but the width tags for the text inputs don't work, anyway here is the php code that prints the html
[PHP]
$result = mysql_query("SE LECT * FROM costs");
while ($row = mysql_fetch_row ($result))
{
$final = $row[2] + $row[3];
$savings = $row[5] - $final;
echo '<tr>';
echo '<form action="process .php" method="post">' , "\n";
echo "<input type='hidden' name='id' value='$row[0]'>","\n";
echo '<td align="center" bgcolor="#dbb47 b">', $row[1], "</td>\n";
echo '<td bgcolor="#f2e1c d"> <input type="text" name="quan" width="10" value="1"></td>', "\n";
echo '<td align="center" bgcolor="#dbb47 b">$', $row[2], "</td>\n";
echo '<td align="center" bgcolor="#f2e1c d">$', $row[3], "</td>\n";
echo '<td align="center" bgcolor="#dbb47 b">$', $final, "</td>\n";
echo '<td align="center" bgcolor="#f2e1c d">$', $row[5], "</td>\n";
echo '<td align="center" bgcolor="#dbb47 b">$', $savings, "</td>\n";
echo "<td bgcolor='#f2e1c d'><input type='submit' value='Calculat e'></td>\n";
echo "</form>\n";
echo '</tr>';
}
[/PHP]
just for ease below is the html that is printed, this is coppied from the Firefox DOM inspector
[CODE=html]
<tr><form action="process .php" method="post">
<input type='hidden' name='id' value='2'>
<td align="center" bgcolor="#dbb47 b">Letter 1oz</td>
<td bgcolor="#f2e1c d"> <input type="text" name="quan" width="10" value="1"></td>
<td align="center" bgcolor="#dbb47 b">$0.312</td>
<td align="center" bgcolor="#f2e1c d">$0.078</td>
<td align="center" bgcolor="#dbb47 b">$0.39</td>
<td align="center" bgcolor="#f2e1c d">$0.41</td>
<td align="center" bgcolor="#dbb47 b">$0.02</td>
<td bgcolor='#f2e1c d'><input type='submit' value='Calculat e'></td>
</form>
</tr><tr><form action="process .php" method="post">
<input type='hidden' name='id' value='3'>
<td align="center" bgcolor="#dbb47 b">Letter 2oz</td>
<td bgcolor="#f2e1c d"> <input type="text" name="quan" width="10" value="1"></td>
<td align="center" bgcolor="#dbb47 b">$0.437</td>
<td align="center" bgcolor="#f2e1c d">$0.078</td>
<td align="center" bgcolor="#dbb47 b">$0.515</td>
<td align="center" bgcolor="#f2e1c d">$0.58</td>
<td align="center" bgcolor="#dbb47 b">$0.065</td>
<td bgcolor='#f2e1c d'><input type='submit' value='Calculat e'></td>
</form>
</tr>
[/CODE]
and above all of the php code and fancy stuff is some simple html that starts the table off with some table colom titles here is the code for that
[CODE=html]
<table align="center">
<tr align="center">
<td align="center" bgcolor="#dbb47 b">Product</td>
<td align="center" bgcolor="#f2e1c d" width="75">Quan tity</td>
<td align="center" bgcolor="#dbb47 b">Postage & <br> Handeling</td>
<td align="center" bgcolor="#f2e1c d">Postage <br> Application</td>
<td align="center" bgcolor="#dbb47 b">Final <br> Cost</td>
<td align="center" bgcolor="#f2e1c d">1st CL<br>Postal<br >Price</td>
<td align="center" bgcolor='#dbb47 b'>Savings <br> Bottom <br> Line</td>
<td> </td>
</tr>
[/CODE]
Note: this is the same table and is actualy above all that other stuff
if you would like to see the live version of this here is a link
thanks
eric
Comment