hey ppl,
you helped me out allot of times, so i come back to you once again, i just transfered my website from a local pc(for testing) to a webserver @ my hosting.
now some parts arent working correctly.
some extra info about the page:
What kind of web page is it: Webshop
what was the server is tested it on: windows xp machine with xampp installed
what is the server where i get the errors: realy have no idea.
well here is my first problem:
when i add an item to my shopping cart everything goes fine and it looks like this:
http://img269.imageshack.us/img269/1344/afb1s.png
then i press on the shopping cart icon and i get the following error:
http://img824.imageshack.us/img824/3683/afb2.png
also when i add extra products it's not stored.
this all works well on the local machine but not there.
as you can see i get the following error:
Er staat 1 product in uw winkelwagen.
SELECT naam, prijs6, prijs12, prijs24 FROM wijnen WHERE id = ArrayUnknown column 'Array' in 'where clause'
in file /home/rb005851/public_html/cart.php on line 71
Productnaam Hoeveelheid Prijs p/s Totaal
translated for english ppl in here:
there is 1 product in your shopping cart.
SELECT name, price6, price12, price24 FROM wines WHERE id = ArrayUnknown column 'Array' in 'where clause'
in file /home/rb005851/public_html/cart.php on line 71
productname amouth price/piece total
here is the source code, hopefuly you can help me out here :)
<?php
// cart.php
session_start();
include "header.php";
?>
<br>
<br>
<br>
<?php
// Kijk of er iets in de winkelwagen zit
if (empty($_SESSION['cart'])) {
echo "<p>Uw winkelwagen is leeg.</p>\n";
} else {
// Exploden
$cart = explode("|",$_SESSION['cart']);
// Tellen inhoud winkelwagen
$count = count($cart);
if ($count == 1) {
echo "<p>Er staat 1 product in uw winkelwagen.</p>\n";
} else {
echo "<p>Er staan ".$count." producten in uw winkelwagen</p>\n";
} // Ach, gewoon leuke mededeling
// Wat javascriptjes voor het weghalen van producten
// En daarna het begin van een tabel met de inhoud
?>
<script type="text/javascript">
<!--
function removeItem(item) {
var answer = confirm ('Weet u zeker dat u dit product wilt verwijderen?')
if (answer)
window.location="delete_cart_item.php?item=" + item;
}
function removeCart() {
var answer = confirm ('Weet u zeker dat u de winkelwagen wilt leeghalen?')
if (answer)
window.location="delete_cart.php";
}
//-->
</script>
<form method="post" name="form" id="form" action="update_cart.php">
<table>
<tr>
<td width="250"><b>Productnaam</b></td>
<td width="150"><b>Hoeveelheid</b></td>
<td width="150"><b>Prijs p/s</b></td>
<td width="40"><b>Totaal</b></td>
<td width="40"> </td>
</tr>
<?php
// Totaal (komt later wel terug)
$total = 0;
$i = 0;
// Show cart
foreach($cart as $products) {
// Split
/*
$product[x] -->
x == 0 -> product id
x == 1 -> hoeveelheid
*/
$product = explode(",",$products);
// Get product info
$sql = "SELECT naam, prijs6, prijs12, prijs24
FROM wijnen
WHERE id = ".$product[0];
$query = mysql_query($sql) or die (mysql_error()."<br>in file ".__FILE__." on line ".__LINE__);
$pro_cart = mysql_fetch_object($query);
$i++;
echo "<tr>\n";
echo " <td>".$pro_cart->naam."</td>\n"; // naam
echo " <td><input type=\"hidden\" name=\"productnummer_".$i."\" value=\"".$product[0]."\" />\n"; // wat onzichtbare vars voor het updaten
echo " <input type=\"text\" onChange=\"document.getElementById('form').submit();\" name=\"hoeveelheid_".$i."\" value=\"".$product[1]."\" size=\"2\" maxlength=\"2\" /></td>\n";
if ($product[1] < 12){
echo " <td>€".$pro_cart->prijs6."</td>\n";
$lineprice = $product[1] * $pro_cart->prijs6; // regelprijs uitrekenen > hoeveelheid * prijs
$lineprice = number_format($lineprice,2,".","");
}
elseif($product[1] <= 23){
echo " <td>€".$pro_cart->prijs12."</td>\n";
$lineprice = $product[1] * $pro_cart->prijs12; // regelprijs uitrekenen > hoeveelheid * prijs
$lineprice = number_format($lineprice,2,".","");
}
elseif($product[1] >= 23){
echo " <td>€".$pro_cart->prijs24."</td>\n";
$lineprice = $product[1] * $pro_cart->prijs24; // regelprijs uitrekenen > hoeveelheid * prijs
$lineprice = number_format($lineprice,2,".","");
}
echo " <td align='right'>€".$lineprice."</td>\n";
echo " <td align='right'><a href=\"javascript:removeItem(".$i.")\"><img src='images/delete.png' border='0'></td>\n"; // Verwijder, mooi plaatje van prullebak ofzo
echo "</tr>\n";
echo "<tr>";
// Total
$total = $total + $lineprice; // Totaal updaten
$total = number_format($total,2,".","");
}
?>
<hr width="755" align="left"></hr>
<tr>
<td></td><td></td>
<td>
<b>Verzendkosten</b>
<td align='right'>
€5,95
<?php
$verzendkosten = number_format("5.95",2);
$total = $total + $verzendkosten;
?>
</tr>
<tr>
<td><input type="hidden" name="totaal" value=<?php echo $total;?>></td>
<td></td>
<td><b>Totaal<b></td>
<td align='right'>€<?php echo $total; ?></td>
<td> </td>
</tr>
<tr>
<td colspan="2"> </td>
<td colspan="4"><a href="klantgegevenstemp.php?total=<?php echo $total;?>">Afrekenen</a></td>
</tr>
</table>
</form>
<?php
}
include "footer.php";
?>