Tolong pilih kategori sesuai, jenis posting (diskusi atau bukan) dan sertakan tag/topik yang sesuai seperti komputer, java, php, mysql, dll. Promosi atau posting tidak pada tempatnya akan kami hapus!
- Bagi Anda yang ingin mendaftar, baca link berikut:
http://diskusiweb.com/discussion/50491/how-to-registrasi-diskusiweb-com-baca-ini-terlebih-dahulu
- Cara menyisipkan kode program supaya tampil rapi dan terformat dengan baik di diskusiweb.com: http://www.diskusiweb.com/discussion/50415/cara-menyisipkan-kode-program-di-diskusiweb-com
- Cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1
http://diskusiweb.com/discussion/50491/how-to-registrasi-diskusiweb-com-baca-ini-terlebih-dahulu
- Cara menyisipkan kode program supaya tampil rapi dan terformat dengan baik di diskusiweb.com: http://www.diskusiweb.com/discussion/50415/cara-menyisipkan-kode-program-di-diskusiweb-com
- Cara posting gambar/image di post Anda: http://www.diskusiweb.com/discussion/47345/cara-menyisipkan-menyertakan-image-pada-posting/p1
tabel keranjang belanja ad to cart sistem cek box masalahnya di combo box jumlah product
halo pak mau tanya .saya ada sistem tabel belanja dengan siste cekbox sperti ini.jika saya pilih produk paling bawahdan jumlah produknya..yang ke kirim ke database jumalh produk paling atas
untuk coding actionya sperti ini
<?php
if(isset($_POST['submit'])) {
$id_array = $_POST['data']; // return array
$id_array2 = $_POST['jmlbeli']; // return array
$menu = implode($_POST['jmlbeli'], ', ');
$id_count = count($_POST['data']); // count array
//$id_count= count($_POST['jmlbeli']); // count array
for($i=0; $i < $id_count; $i++) {
$id= $id_array[$i];
$idd = $id_array2[$i];
//$jml =$_POST['jmlbeli']; // count array
mysqli_query($konek,"INSERT INTO orders_temp (id_product,jumlah)
VALUES ('$id','$idd')");
}
echo "<script>alert('add to cart ');history.go(-1) ";
}
?>
dan tabel combo box jumlah beli sperti ini
<?php
echo" <select name='jmlbeli[]' id='jmlbeli' > ";
for ($j=1;$j <= $r3['stok'];$j++){
if($j == $r3['jumlah']){
echo "<option name='jmlbeli[]' selected>$j";
}else{
echo "$j";
}
}
echo "";?>

untuk coding actionya sperti ini
<?php
if(isset($_POST['submit'])) {
$id_array = $_POST['data']; // return array
$id_array2 = $_POST['jmlbeli']; // return array
$menu = implode($_POST['jmlbeli'], ', ');
$id_count = count($_POST['data']); // count array
//$id_count= count($_POST['jmlbeli']); // count array
for($i=0; $i < $id_count; $i++) {
$id= $id_array[$i];
$idd = $id_array2[$i];
//$jml =$_POST['jmlbeli']; // count array
mysqli_query($konek,"INSERT INTO orders_temp (id_product,jumlah)
VALUES ('$id','$idd')");
}
echo "<script>alert('add to cart ');history.go(-1) ";
}
?>
dan tabel combo box jumlah beli sperti ini
<?php
echo" <select name='jmlbeli[]' id='jmlbeli' > ";
for ($j=1;$j <= $r3['stok'];$j++){
if($j == $r3['jumlah']){
echo "<option name='jmlbeli[]' selected>$j";
}else{
echo "$j";
}
}
echo "";?>
Tagged:
Comments