HI!
Sorry, Newbie:( ...
I want to post the output of my script by adding a checkbox to it.
(the output consists of the multiple information that the user has
previously posted)
If the checkbox is checked the script should take the data from a
table in the database and pass it to an other table in the same database.
The problem is that the script does not post the variables..
This is what I did till now:
First I have transformed the output it self into a form and added the
checkbox and the submit button:
The form:
<form method=post action="AddCart.php"
enctype="application/x-www-form-urlencoded" name="PostForm">
<table width="734" height="76" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="734">
<div align="right">
<?=$ListingTable?>
</div></td>
</tr>
<tr>
<td><div align="right">
<input name="s2" type="submit" value="Add to cart" />
</div></td>
</tr>
</table>
</form>
The checkbox is in an other file, in the<?=$ListingTable?>:
<input name=cartlist type=checkbox id=AdCart value=$_GET[ListingID] />
In my case the action of the cart is in an other file:AddCart.php.
:
<?
require_once("conn.php");
if(isset($_POST[s2]))
{
$catInfo = explode("|", $_POST[SelectCategory]);
$CategoryID = $catInfo[0];
$SubcategoryID = $catInfo[1];
$q1 = "insert into cart1 set
CategoryID = '$CategoryID',
ListingID = '$ListingID',
city = '$_POST[city]',
state = '$_POST[state]',
Price = '$_POST[Price]";
mysql_query($q1);
}
header("location:manage.php");
exit();
?>
What am I doing wrong?
ThankYou!