mySQL stopped inserting after using HTML POST method
Posted: Sun Feb 15, 2004 2:36 pm
I have recently changed my HTML code where my inserting into mySQL stopped working
BEFORE I were using:
echo "<a href=\"cart1.php?action=add_item&id=$itemId&qty=1&colorid=$color\"><img src=\"http://www.aaa.gif\" border=\"0\"></a>\n";
which called cart1.php
function AddItem($itemId, $qty, $color)
{
@mysql_query("insert into cart(cookieId, itemId, qty)
values('" . GetCartId() . "', $itemId, $qty)");
...
...
This worked fine inserting the values
AFTER I used only HTML Post (calling the exact same php code):
<td valign="top"><form name="form"method="post"action="cart1.php">
I can echo all variables on the screen but nothing is inserted
function AddItem($id, $qty, $color)
{
$cookieId = GetCartId();
@mysql_query("insert into cart(cookieId, itemId, qty)
values('" . GetCartId() . "', $itemId, $qty)");
echo $cookieId;
echo $color;
echo $id;
echo $qty
WHAT is the difference between the two methods????
thanks
BEFORE I were using:
echo "<a href=\"cart1.php?action=add_item&id=$itemId&qty=1&colorid=$color\"><img src=\"http://www.aaa.gif\" border=\"0\"></a>\n";
which called cart1.php
function AddItem($itemId, $qty, $color)
{
@mysql_query("insert into cart(cookieId, itemId, qty)
values('" . GetCartId() . "', $itemId, $qty)");
...
...
This worked fine inserting the values
AFTER I used only HTML Post (calling the exact same php code):
<td valign="top"><form name="form"method="post"action="cart1.php">
I can echo all variables on the screen but nothing is inserted
function AddItem($id, $qty, $color)
{
$cookieId = GetCartId();
@mysql_query("insert into cart(cookieId, itemId, qty)
values('" . GetCartId() . "', $itemId, $qty)");
echo $cookieId;
echo $color;
echo $id;
echo $qty
WHAT is the difference between the two methods????
thanks