http://quo-vadis.me....oduct.php?pid=1
i would like to be able to add a different quantity at the moment its set to 1, so when the user selects 3 it would add 3 to the cart the problem is how do i get the selected value to be stored in a variable
would it be something like
$val=quantity.selectedindex;
here is my code for the page
i have passed a number over easily by manually putting it in but when i try and put the select value it doesnt wanna know
<?php
//using this variable to track down any possible problems
$problem=FALSE;
//validating that a product id has been passed to this page
if (isset($_GET['pid'])){
$pid=(int)$_GET['pid'];
require_once('../include/mysqlconnection.php');
//creating the query to retrive the information required
$query="select * from Product where product_id=" .$pid;
$result=mysql_query($query);
//the print id was typecast to int for security purposes
if (mysql_num_rows($result)==1){
while ($row = mysql_fetch_array($result)){
$page_title=$row['Product_name'];
$name=$row['Capacity'];
$price=$row['Price'];
$pic=$row['Picture'];
$ps=$row['Photo_Support'];
$vs=$row['Video_Support'];
$pm=$row['PowerM'];
$pv=$row['PowerV'];
$as=$row['AudioSupport'];
$ns=$row['NoOfSongs'];
$nv=$row['NoOfVideos'];
$cs=$row['Colour_Screen'];
}
include ('./include/header.html');
//start the html page
$test=$row['Product_name'];
//build the main content of the page
echo "<div id='main2'>";
echo "<fieldset id='fieldresult'>";
//Display a header
echo "<div id='ablue'>";
echo "<div id='buyboxDivId' class='buying'>
<table id='buyboxTable' border='0' cellspacing='0' cellpadding='0' class='buyBox' width='215'>
<tr>
<td width='190' class='topLeft'>
<table cellspacing='0' cellpadding='0' border='0' align='center'>
<tr>
<td align='center' style='text-align: center;'>
<div style='padding: 4px 0px;'>
<b>Price:</b> <b>$$price</b><br />In stock<br />Dispatched from and sold by <b>Quo-Vadis.me.uk</b>
</div>
<div align='center' style='margin-bottom: 4px;'><b class='small'>Quantity: </b><select name='quantity'><option value='1' selected>1</option><option value='2'>2</option><option value='3'>3</option><option value='4'>4</option></select></div><input type='hidden' name='maap_bb_qty_limit' value='30' />
<span id='addToCartSpan'>
<a href='add_cart.php?pid=$pid&quant=2'><input type='image' src='http://g-ecx.images-amazon.com/images/G/02/nav2/dp/btn-atc._V45449963_.gif' width='166' alt='Add to Shopping Basket' name='submit.add-to-cart' height='27' border='0' /></a>
</span>
<br />
</td></tr></table>
</td>
<td width='13' class='topRight'> </td>
</tr>
<tr>
<td class='bottomLeft'> </td>
<td class='bottomRight' height='12'> </td>
</tr>
</table>
</div></div>";
echo "<table id='resultstab' border='0' >
<tr><td rowspan='4'><img src='../images/$pic' border=0 alt=''></td>
<td>Product Name</td><td><b><font size='+1'>$page_title</font></b></td>
</tr><tr><td>Price : $ </td><td>$price</td></tr><tr>
<td>Photo Support </td><td>$ps</td></tr><tr><td>Power For Video</td><td>$pv</td></tr></table>";
echo '</fieldset>';
echo '</div>';
}
else
{
$problem=TRUE;
}
mysql_close();
}
else
{
$problem=TRUE;
}
if ($problem){
$page_title='Error';
include('./include/header.html');
echo '<div align=\"center/"> This Page has been accessed in error! </div>';
}
include ('./include/footer.html');
?>
and yes i borrowed the blue box from amazon, thought it looked nice lol..
thanks again
dan

New Topic/Question
Reply




MultiQuote



|