mastah mau tanya Misal saya Punya 2 Input type pertama saya ketik id di input type satu maka
nama akan Muncul di input type 2 Mirip dengan Dropdown hanya saya mau pake input type text
bagaimana yah mas Mohon Bantuannya

Lihat semua 3 jawaban

Silahkan login untuk menjawab!

input soall

Rheyank Iwan Nytt · Jul 24, 2013
mas mau nanya ,, saya buat input soal dengan 2 text area ,, tpi masih gagal ..
data uda berhasil diinput tapi dalam database tidak tersimpan ,, pa da yang salah ,,
ne scriptnya .
input.php
<!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=utf-8" />
<title>English Lesson Of Grammar</title>
<link href="css/rheyank_style.css" rel="stylesheet" type="text/css" />

<link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />

<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/ddsmoothmenu.js">

/***********************************************
* Smooth Navigational Menu- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>

<script type="text/javascript">

ddsmoothmenu.init({
	mainmenuid: "menu", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})

</script>
<style type="text/css">
<!--
.style1 {color: #75a62c}
.style2 {
	color: #333;
	font-weight: bold;
}
-->
</style>
</head>
<body>

<div id="body">
	<div id="header"></div> 
	<!-- end of header -->
    
    <div id="menu" class="ddsmoothmenu">
        <ul>
            <li><a href="index.php">Home</a></li>
            <li><a href="grammar.php">Grammar</a></li>
          	<li><a href="soal.php" class="selected">Excercise</a></li>
          	<li><a href="about.php">About</a></li>
        </ul>
        <br style="clear: left" />
    </div> <!-- end of menu -->

    <div id="main">    	
	    <h2>Masukan Soal !!! </h2>
        <div class="col_l">
            <br class="cleaner h20" />
            <div id="contact_form">
			      <form name="formsoal" id="formsoal" method="post" action="simpansoal.php">  
							<p>
			                <label for="soal">SOAL</label> 
                            <textarea id="soal" name="soal[1]" rows="40" cols="10" class="ckeditor"></textarea>
   							</p>
                            <p>
                                <label for="j1">Jawaban A</label> 
                                <input type="text" name="j1[1]" class="required input_field" />
                            </p>
                            <p>
                                <label for="j2">Jawaban B</label> 
                                <input type="text" name="j2[1]" class="validate-email required input_field" />
                            </p>
							<p>
                                <label for="j3">Jawaban C</label> 
                                <input type="text" name="j3[1]" class="validate-email required input_field" />
                            </p>
							<p>
                                <label for="j4">Jawaban D</label> 
                                <input type="text" name="j4[1]" class="validate-email required input_field" />
                            </p>
							<p class="no_margin_right">
                                <label for="jbenar[1]">Kunci Jawaban</label> 
                                <input type="text" name="jbenar" class="input_field" />
                            </p>
							<p class="no_margin_right">
                                <label for="tipe">Materi</label> 
                                <input type="text" name="tipe[1]" class="input_field" />
                            </p>
							<p>
			                <label for="soal">SOAL</label> 
                            <textarea id="soal" name="soal[2]" rows="0" cols="0" class="ckeditor"></textarea>
   							</p>
                            <p>
                                <label for="j1">Jawaban A</label> 
                                <input type="text" name="j1[2]" class="required input_field" />
                            </p>
                            <p>
                                <label for="j2">Jawaban B</label> 
                                <input type="text" name="j2[2]" class="validate-email required input_field" />
                            </p>
							<p>
                                <label for="j3">Jawaban C</label> 
                                <input type="text" name="j3[2]" class="validate-email required input_field" />
                            </p>
							<p>
                                <label for="j4">Jawaban D</label> 
                                <input type="text" name="j4[2]" class="validate-email required input_field" />
                            </p>
                            <p class="no_margin_right">
                                <label for="jbenar">Kunci Jawaban</label> 
                                <input type="text" name="jbenar[2]" class="input_field" />
                            </p>
							<p class="no_margin_right">
                                <label for="tipe">Materi</label> 
                                <input type="text" name="tipe[2]" class="input_field" />
                            </p>
                            <div class="cleaner h20"></div>
            							
                            <input type="submit" value="Save" id="submit" name="submit" class="submit_btn float_l" />
                            <input type="reset" value="Reset" id="reset" name="reset" class="submit_btn float_r" />
                      </form>
	            </div> 
        </div>
		        <br class="cleaner" />
    </div> <!-- end of main -->
    
    <div id="footer"></div>
        <div class="cleaner"></div>
</div> <!-- end of footer -->

<div id="cr_bar_wrapper">
	<div id="cr_bar">
    	Copyright © 2013 Designed by <a href="http://www.facebook.com/rheyank.iwan">Rheyank Iwan</a>    </div>
</div>

</body>
</html>

ne script simpannya mas .
simpan.php
<?
//Cek Tombol 
foreach ($_POST){
//Kirimkan Variabel
$soal = $_POST['soal[1]'];
$j1 = $_POST['j1[1]'];
$j2 = $_POST['j2[1]'];
$j3 = $_POST['j3[1]'];
$j4 = $_POST['j4[1]'];
$jbenar = $_POST['jbenar[1]'];
$tipe = $_POST['tipe[1]'];
$soal = $_POST['soal[2]'];
$j1 = $_POST['j1[2]'];
$j2 = $_POST['j2[2]'];
$j3 = $_POST['j3[2]'];
$j4 = $_POST['j4[2]'];
$jbenar = $_POST['jbenar[2]'];
$tipe = $_POST['tipe[2]'];

//validasi data jika pesan kosong
if (empty($_POST['soal[1]'])|| empty($_POST['j1[1]'])|| empty($_POST['j2[1]'])|| empty($_POST['j3[1]'])|| empty($_POST['j4[1]'])|| empty($_POST['jbenar[1]'])|| empty($_POST['tipe[1]'])|| empty($_POST['soal[2]'])|| empty($_POST['j1[2]'])|| empty($_POST['j2[2]'])|| empty($_POST['j3[2]'])|| empty($_POST['j4[2]'])|| empty($_POST['jbenar[2]'])|| empty($_POST['tipe[2]'])) 
{
?>
<script language="JavaScript">
alert('Data Harap Dilengkapi');
document.location='inputsoal.php';
</script>
<?
}
//Jika Validasi Terpenuhi
else
{
//Memanggil File Koneksi Database
mysql_connect("localhost", "root", "12345");
mysql_select_db("english");

//Masukan data ke Table siswa
     $query ="INSERT INTO soal VALUES('$id','$soal','$j1','$j2','$j3','$j4','$jbenar','$tipe')";
     $hasil = mysql_query($query);  
     if($hasil){  
//Jika Sukses
//echo "Data telah diinput";
?>
<script language="JavaScript">
alert('Data Berhasil diinput');
document.location='viewsoal.php';
</script>
<?

}
else
{
//Jika Gagal
//echo "Data gagal diinput, Silakan Ulangi";
}
}
}
?>
<script language="JavaScript">
alert('Data Gagal diinput,, Silakan ulangi');
document.location='inputsoal.php';
</script>
mhon bantuannya mas ,, sukses slalu

Lihat semua 6 jawaban

Silahkan login untuk menjawab!
Selamat malam mas elyx, saya dapet masalah kenapa totpoint ga bisa muncul otomatis ya? ini sourcenya...
<span class="number input margin-right">
							<button type="button" class="button number-down">-</button>
							<input type="text" name="qty[<?php echo $no;?>]" value='<?php echo $t['qty']?>' onchange="grandTotal()" size="4" class="qty input-unstyled">
							<button type="button" class="button number-up">+</button>
						</span>
						<input type="text" name="perpoint[<?php echo $no;?>]" value="<?php echo $t['point']?>" onchange="grandTotal()" size="4" class="perpoint" >							
						<input type="text" name="totpoint[<?php echo $no;?>]" value='0' size="4" class="totpoint" >								
						</td>
						<td>
							<span class="button-group compact ">
							<a href="<?php echo $base_url?>/delete-item/<?php echo $t['id']?>/<?php echo $dua?>" class="button icon-trash with-tooltip" title="Delete" onclick='return confirm("Are you sure delete this data?");'></a>
							</span>
						</td>	
					</tr>
					
				<?php $no++;?>
				
				<script type="text/javascript" src="<?php echo $base_url?>/content/project/jquery-1.7.2.min.js"></script>
				<script type="text/javascript">
				$(function(){
					$('.qty').live('keyup',function(){
					var totpoint = $(this).parent().next().next().find('.totpoint');
					var perpoint = $(this).parent().next().find('.perpoint');
					$(totpoint).val($(this).val() * $(perpoint).val());
					});
				});

				
				function grandTotal(){
					var qty = 0;
					$('.qty').each(function(){
					qty += parseFloat($(this).val());
					$('input[name="total_qty"]').val(qty);
					});
				}	

				</script>
				

mohon bantuanya,
Terimakasih...

Lihat semua 1 jawaban

Silahkan login untuk menjawab!
tabel1=produk, tabel2=produk2 caranya gmana biar bisa tampil semua?

<?
while ($row=mysql_fetch_array($query)){
$idshop=$row;
$idbrg=$row;
$iduser=$row;

$trow=mysql_fetch_array($pemesanan);
$idpesan=$trow;

//translate id

$transbrg=mysql_db_query($db,"select * from produk inner join produk2 where idbrg='$idbrg'",$koneksi);


while ($row=mysql_fetch_array($transbrg)){
$namabrg=$row;
$hargabrg=$row;
$total=$hargabrg+$total;
}

?>
<?
			while ($row=mysql_fetch_array($query)){
			$idshop=$row['idshop'];
			$idbrg=$row['idbrg'];
			$iduser=$row['iduser'];
			
			$trow=mysql_fetch_array($pemesanan);
			$idpesan=$trow['idpesan'];
			
				//translate id
			
			$transbrg=mysql_db_query($db,"select * from produk inner join produk2 where idbrg='$idbrg'",$koneksi);	
			
			
				while ($row=mysql_fetch_array($transbrg)){
					$namabrg=$row['namabrg'];
					$hargabrg=$row['hargabrg'];
					$total=$hargabrg+$total;
				}
				
			?> 

Lihat semua 1 jawaban

Silahkan login untuk menjawab!

Export Ke CSV

danura · Jul 12, 2013
mas eliyx mau tanya bagaimana yahh cara export database ke dalam csv file via php ??
thks Sir

Lihat semua 1 jawaban

Silahkan login untuk menjawab!

dua bahasa

oktav · Jul 11, 2013
kak,kalau buat website dengan dua bahasa gimana??
mohon bantuannya doooong.....

Lihat semua 1 jawaban

Silahkan login untuk menjawab!