Ok this is the problem im running short on a deadline and im still trying to create a shopping cart system that will send the infromation to paypal, here is a link to the products page
www.heismy.com/beta/test/products.htm
click on one of the product sections
ok, and here is what my database looks like..
Store-
Products-
ID
product_id
gender
description
image
price
ok, when a visitor comes to one of the product section pages, they are able to choose different shirts to view and then at the bottom they are able to choose the size and to add it to the cart. the php script that i have written grabs the product id and loads it into a hidden field in the form. below is the script that i have written to do the following.
this is before the html starts
<?php
if(empty($GET["select"])) {
$proid = '1m';
}
else {
$proid=$GET["select"];
}
mysql_connect ("localhost","user","pass") or die(mysql_error() . "<B>Can't connect to the server</B>");
mysql_select_db("store") or die(mysql_error() . "<B>Specified database does NOT exist</B>");
$query = "select description, price, image, product_id ,gender from products WHERE product_id = '$proid' ";
$result = mysql_query($query) or die(mysql_error() . "<B>Bad Query</B>");
$num= mysql_num_rows($result);
do {
$img=$row['image'];
$desc=$row['description'];
$money=$row['price'];
$productid=$row['product_id'];
}
while($row = mysql_fetch_array($result));
?>
this is in between the html tags...
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFFFFF" valign="top" align="center">
<form action="m_shirt.php" method="get" name="list" id="list">
<div align="center">
<select name="select">
<option value="1m" selected>Truth</option>
<option value="2m">Integrity</option>
<option value="3m">Freedom</option>
<option value="4m">Role Model</option>
<option value="5m">Grace</option>
<option value="6m">Authority</option>
<option value="7m">Example</option>
<option value="8m">Future</option>
</select>
<input type="image" name="Submit2" value="Select" src="images/select.jpg">
</div>
</form>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#99CCFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td>
<center>
<?php echo"<img src=\"http://www.heismy.com/beta/test/images/male/$img\">";?>
</center>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#99CCFF" height="11">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top" bgcolor="#FFFFFF">
<center>
<img src="images/male/back.jpg" width="396" height="364">
</center>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#99CCFF" height="19">
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td>
<center>
<font face="Arial, Helvetica, sans-serif">
<?php echo"$desc"?>
</font>
</center>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#99CCFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFFFFF">
<center>
<font face="Arial, Helvetica, sans-serif">
<?php echo "$money"?>
</font>
</center>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="85" bgcolor="#99CCFF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="79" align="center" valign="top" bgcolor="#FFFFFF">
<center>
<font face="Arial, Helvetica, sans-serif"> </font>
<form action="add_cart.php" method="post" name="form2" target="_self">
<p>
<input name="product_id" type="hidden" id="product_id" value=<?php echo "$productid" ?> >
</p>
<p>Sizes </p>
<p>
<input type="checkbox" name="checkbox" value="s">
s
<input type="checkbox" name="checkbox2" value="m">
m
<input type="checkbox" name="checkbox3" value="l">
l
<input type="checkbox" name="checkbox4" value="xl">
xl
<input type="checkbox" name="checkbox5" value="2xl">
2xl </p>
<p><font face="Arial, Helvetica, sans-serif"><img src="images/add_cart.gif" width="74" height="22"></font>
<font face="Arial, Helvetica, sans-serif"><img src="images/view_cart.gif" width="74" height="22"></font>
</p>
</form>
<font face="Arial, Helvetica, sans-serif"> </font>
</center>
</td>
</tr>
</table>
</td>
</tr>
</table>
I would really Really appreciate some help on this, take into mind im fairly new to php.. thanks in advance.
Mike