I am using the form and php code below to add an item to a shopping cart but it isn't working.
Any suggestions please?
Many thanks.
Any suggestions please?
Many thanks.
Code:
<?php
include("db.php");
// Get a connection to the database
$cxn = mysql_connect($dbServer, $dbUser, $dbPass, $dbName) or die(mysql_error());
//select database
$db = mysql_select_db("koscart", $cxn) or die(mysql_error());
//add record
$sql = ("insert into cart(cookieId, ITEMID, QTY) values('" . GetCartId() . "', $ITEMID, $QTY)") or die(mysql_error());
//execute sql query
$sql_result = mysql_query($sql , $cxn) or die(mysql_error());
ShowCart();
?>
<form action="[URL unfurl="true"]https://se4.g.com/~k/ShoppingBagForm.php"[/URL] method="POST">
<input type="hidden" name="id" value="1247001">
<table border="0" width="126">
<tr align="right">
<td width="56"><strong>QTY </strong></td>
</tr>
<tr align="right">
<td><select name="QTY" size="1">
<option selected>1</option>
<option>2</option>
<option>3 </option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8 </option>
<option>9</option>
</select></td>
</tr>
<tr align="right">
<td colspan="2"><input
type="image" name="I1" src="../Images/ADD-TO-CART.jpg"
align="bottom" border="0" width="126" height="45"> </td>
</tr>
</table>
</form>