MENYIMPAN DENGAN TOMBOL DARI IMAGE

Fr7Frans · Sep 17, 2011
262180_1653255109935_179378807.jpg

ini Code nya bang ellyx ???
<?php
<? 
mysql_connect("","","");
mysql_select_db("handphone");
$type=$_GET['type'];
$tampil=mysql_query("select * from nokia where type='$type'");
while ($data=mysql_fetch_array($tampil))
{$no++;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {font-weight: bold}
-->
</style>
</head>

<body>
<table width="50%" border="1" align="center">
  <tr>
    <td colspan="3"><div align="center"><strong>KERANJANG</strong></div></td>
  </tr>
  <tr>
    <td width="35%"><strong>TYPE</strong></td>
    <td colspan="2"><strong>
      <label>
        <input name="type" type="text" class="style1" id="type" value="<? echo $data[0]; ?>" />
      </label>
    </strong></td>
  </tr>
  <tr>
    <td><strong>HARGA</strong></td>
    <td colspan="2"><input name="harga" type="text" class="style1" id="harga" value="<? echo $harga[1]; ?>" /></td>
  </tr>
  <tr>
    <td><strong>JUMLAH</strong></td>
    <td colspan="2"><input name="jumlah" type="text" class="style1" id="jumlah" value="<? echo $jumlah; ?>" maxlength="3" /></td>
    <?
	$jumlah=$_POST['jumlah'];
	$total=$data[1]*$jumlah['jumlah'];
	?>
  </tr>
  <tr>
    <td><strong>TOTAL</strong></td>
    <td colspan="2"><input name="total" type="text" class="style1" id="total" value="<? echo $total; ?>" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td height="47"><div align="center"><a href="depan.php"><img src="BUTTON/AddtoCart.gif" width="92" height="25" border="0" /></a></div></td>
    <td width="31%"><div align="center"><img src="Batal.jpg" width="89" height="21" /></div></td>
    <td width="34%"><label>
    </label>
    <img src="submit.jpg" width="89" height="21" /></td>
  </tr>
</table>
</body>
</html>
<? } ?>

?>


tolong dulu bang...
gimana caranya utk menyimpan data tersebut ke DATABASE,
Field Type dan Harga dari database.
Field Jumlah di input manual, jika di input jlh maka TOTAL akan di proses.
di TOTAL = jumlah * harga.
Silahkan login untuk menjawab!
1
Loading...
Ellyx Christian · Sep 17, 2011 · 1 Suka · 0 Tidak Suka
kamu sudah tahu cara menyimpan data? kenapa bertanya lagi?
<?php
<? 
mysql_connect("","","");
mysql_select_db("handphone");
$type=$_GET['type'];
$tampil=mysql_query("select * from nokia where type='$type'");
while ($data=mysql_fetch_array($tampil))
{$no++;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {font-weight: bold}
-->
</style>
</head>
 
<body>
<table width="50%" border="1" align="center">
  <tr>
    <td colspan="3"><div align="center"><strong>KERANJANG</strong></div></td>
  </tr>
  <tr>
    <td width="35%"><strong>TYPE</strong></td>
    <td colspan="2"><strong>
      <label>
        <input name="type" type="text" class="style1" id="type" value="<? echo $data[0]; ?>" />
      </label>
    </strong></td>
  </tr>
  <tr>
    <td><strong>HARGA</strong></td>
    <td colspan="2"><input name="harga" type="text" class="style1" id="harga" value="<? echo $harga[1]; ?>" /></td>
  </tr>
  <tr>
    <td><strong>JUMLAH</strong></td>
    <td colspan="2"><input name="jumlah" type="text" class="style1" id="jumlah" value="<? echo $jumlah; ?>" maxlength="3" /></td>
    <?
	$jumlah=$_POST['jumlah'];
	$total=$data[1]*$jumlah['jumlah'];
	?>
  </tr>
  <tr>
    <td><strong>TOTAL</strong></td>
    <td colspan="2"><input name="total" type="text" class="style1" id="total" value="<? echo $total; ?>" /></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr>
    <td height="47"><div align="center"><a href="depan.php"><img src="BUTTON/AddtoCart.gif" width="92" height="25" border="0" /></a></div></td>
    <td width="31%"><div align="center">
<button style="background:url(Batal.jpg);border:0;width:89px;height:21px;text-indent:-999px;overflow:hidden" type="reset">Batal</button>
</div></td>
    <td width="34%"><label>
    </label>
<button style="background:url(submit.jpg);border:0;width:89px;height:21px;text-indent:-999px;overflow:hidden" type="submit">Submit</button></td>
  </tr>
</table>
</body>
</html>
<? } ?>
 
?>
0
Loading...
Fr7Frans · Sep 18, 2011 · 0 Suka · 0 Tidak Suka
bang,,, maksud aq gimana cara menyimpan data dengan tombol button dari gambar.
cara yang kubuat itu masih belum bisa disimpan bang....
dia tersimpan, tapi nilai nya semua nol.

tolong bang gimana cara nya menyimpan data pake image sebagai tombol buttonnya..
0
Loading...
Ellyx Christian · Sep 23, 2011 · 0 Suka · 0 Tidak Suka
setelah saya perhatikan, jika kamu trus memakai koding itu tidak akan mau tersimpan sampai kapanpun. Karena kamu tidak menambahkan tag <form/> tinggal masukkan semua textfield dan dan button ke dalam tag <form/> pasti mau jalan.