Is this how you print a hyperlink passing parameter action , id, qty to another php script?
And printing HTML inside php? I giving three sample code in my program.
I use quotation around HTML TAG and code so can read by php print command.
Code example:
- Hyperlink with parameter to pass
print "<a href = \"cart.php?action=Add&id=" . $column['SKU'] . "&qty=1\">Add Item</a></font></td></tr>";
- Printing HTML tag with PHP print command
print "<TR><TH>Title</TH><Price</TH><TH>Description</TH><TH>Add Item</TD></TR>";
- Here I try to print a drop down list with Javascript onChange event. Notice that I use concatenation between HTML TAG and PHP code. I use \ to respesent quoatation mark.
// print the drop down that will update the qty instantly using Javascript onChange event
// the following syntax will look like this in regular HTML code
// <select name = "$column['SKU']" onChange = "upDateQty(this)"><option
Selected>i</option></select>
[B]code:[/B]
print "<tr width = 15% height = 25><td width = 15% height = 25><font face = verdana size = 1 color = black>";
print "<select name = \"" . $column['SKU'] . "\"onChange = \"updateQty(this)\"";
for ($i = 0; $i <= 20; $i++)
{
print "<option";
if ($rows['QTY'] == $i)
{
print "SELECTED";
}
print ">" . $i . "</option>";
}
print "</select></font></td>";