Mas Elyx,

Saya mau validasi form berdasarkan tutoria dari mas elyx, Validasi PHP ini tadi di dua file php.

Untuk errornya dia gbs mas, ngga muncul notif apapun jadi user mesti input lg dari awal. Saya maunya user hanya mengetik kalimat yang salah saja.

Kl ikutin tutorialnya mau, tp pas diubah jadi 2 file php gbs mas...

Terima kasih,

Lihat semua 6 jawaban

Silahkan login untuk menjawab!

komentar

Wakienk · Jun 17, 2013
ane mau numpang tanya,bagaimana cara menyisipkan komentar dalam tanda petik..makasih

Lihat semua 7 jawaban

Silahkan login untuk menjawab!

Request FW

Danura Aditya · Jun 13, 2013
Sore Mas elix maaf sebelumnya seperrti Biasa pak saya banyak belajar dari mas elixx kali ini saya mau tanya apakah ada rencana mas elix buat tutorial Buat frameworknya ? karena trend sekarang lebih ke frmaework pak, memang banyak tutorial atau userguide di tempat lain tapi seperti biasa mas, kami selalu menunggu updatenya dari mas elix buat kami yg masih awam
thks mas

Lihat semua 2 jawaban

Silahkan login untuk menjawab!
masbro saya mau nanya sesuai tutorial anda yang dibawah ini
http://www.myphptutorials.com/tutorials/1073/autocomplete-memberi-sugesti-saat-user-input-data#_=_

disitu kan saat kita memilih kode barang di input text, maka akan autofill atau mengisi input text nama secara otomatis (sesuai kode brg di database)

kasus saya--> mengubah value select box sesuai inputan textbox

jadi kalau saya input kode brg,
saya puunya select form --> jenis brg(value: mouse, keyboard)

maka value select box tsb akan berubah sesuai dr kode brg yg dipilih

gmn ya caranya?saya pake tutorial masbro ga jalan.. hanya bisa ngubah value input text saja tidak untuk select form

ini full code saya

autocomplete.php
<html>
<head>
	<title>Test Script</title>
	<link rel="stylesheet" href="jquery-ui.css" />
	<script src="jquery-1.9.1.js"></script>
	<script src="jquery-ui.js"></script>
</head>
<body>

<form name="form-member" id="form-member" action="" method="post">
	<table>
    	<tr>
        	<td><label for="nim">Masukan NIM</label></td>
            <td>:</td>
            <td><input id="nim" name="nim" value=""/></td>
        </tr>
    	<tr>
        	<td><label for="nama">Nama</label></td>
            <td>:</td>
            <td><input id="nama" name="nama" value=""/></td>
        </tr>
    	<tr>
        	<td><label for="prodi">PRODI</label></td>
            <td>:</td>
            <td><input id="prodi" name="" value=""/></td>
        </tr>
		<tr>
        	<td><label for="prodi">Program Diploma</label></td>
            <td>:</td>
            <td>
			
			<select name="prodi" >
								<option value="" id="prodi">---Select Field---</option>
								<option value="ti">Teknik Informatika</option>
								<option value="si">Sistem Informasi</option>
			</select>
			
			</td>
        </tr>
		
    </table>
</form>
    
		<script type="text/javascript">
			$(function () {
				$("#nim").autocomplete({
					minLength: 1,
					matchContains: true,
					selectFirst: true,
					source: function (request, response) {
              			$.get("source.php", {term: request.term, data: $("#nim").val()}, 
							function (data) {
               	 				response(data);
            			},"JSON");
					},
					focus: function (event, ui) {
						$("#nim").val(ui.item.nim);
						return false;
					},
					select: function (event, ui) {
						$("#nim").val(ui.item.nim);
						$("#nama").val(ui.item.nama);
						$("#prodi").val(ui.item.prodi);		
					
						return false;
					}
				}).data("ui-autocomplete")._renderItem = function (ul, item) {
					return $("<li>").append("<a>" + item.nim + "</a>").appendTo(ul);
				};
			});
		</script>
	</body>
</html>

source.php
<?php require 'conn.php';

	//isi dengan script koneksi database
	$connection = mysql_connect($server,$user,$pass);
	$dbase = mysql_select_db($db);
	//Simpen koneksi database
    $kode = $_REQUEST['term'];
	
    $sql = "select nim,nama,prodi from mhs where nim like '$kode%'";
    $hs = mysql_query($sql);
    $json = array();
    while($rs = mysql_fetch_array($hs)){
		$json[] = array(
			'nim' => $rs['nim'],
			'nama' => $rs['nama'],
			'prodi' => $rs['prodi']
		
		);
    }
    header("Content-type: application/json");
    echo json_encode($json);
	
?>

mohon dibantu masbro..:)

Lihat semua 1 jawaban

Silahkan login untuk menjawab!
Mohon bantuannya kalo untuk menampilkan data di menu list sesuai dengan menu yang dipilih kita,
contoh kode PHP dibawah :
saya memilih di menu kategori yang berisikan : infras,mi,pelaporan,pembayaran
*tiap kategori tersebut memiliki nama2 didalamnya (misalkan di infras:budi,joko)(mi:mawar,dian) dst.
nah jika kita memilih kategori tersebut akan otomatis muncul nama2nya sesuai kategori yang kita pilih.
bagaimana caranya, mohon pencerahannya, terima kasih :)
<?php
	
	error_reporting(0);
	session_start();
	include "Connect.php";
	
if(empty($_SESSION['username']) AND empty($_SESSION['password'])){
	echo"<center> Lakukan login !<br>";
	echo"<a href=index.php><b>Ulangi Lagi</b></a></center>";
	}
	else{
	$server ="localhost";
	$username ="root";
	$password ="";
	$database ="newproject_db";
	mysql_connect($server,$username,$password)or die("koneksi gagal");
	mysql_select_db($database)or die("Database tidak bisa dibuka");
	
	?>


<!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" />
<meta http-equiv=refresh content=30;url=http://localhost/tes/View.php>
<title>Untitled Document</title>

<style type="text/css">
<!--
.style1 {
	font-size: 26px;
	font-weight: bold;
	
}
.style2 {
	font-size: 14px;
	font-weight: bold;
}
body {
	background-image:url(Website_Background.png);
}
-->
</style>
</head>
<body>
<tr>
<td><marquee direction="right"><div align="left" class="style1"><b><font size="+3"><font class="style1"><?php

				echo date("d-M-Y");
				?></b></font></div></td></marquee></tr>

<table style="width:1000" align="center">
  <tr>
    <td align="center">&nbsp;</td>
  </tr>
  <tr>
    
  </tr>
    <table width="965" border="2" bordercolor="#0033FF">
      <tr>
        <td><form action="Masukin.php?pid=<?php echo $kode; ?>" method="post" enctype="multipart/form-data">
          <table width="700" align="center">
            <tr>
              <td><b>Operator Code</b></td>
              <td>:</td>
              <td><label for="op"></label>
              
              
                <?PHP 
				
$get_status = mysql_query("select kode_operator from operator");
?> 
                <select name="op" id="op" style="width:155px">
                  <option selected="selected"></option>
                                    <?php while($status = mysql_fetch_array($get_status)){ ?>
                  <option><?php echo $status['kode_operator']; ?></option>
                  <?php } ?>
                                
              </select></td>
              </tr>
            <tr>
              <td><b>Category Problem</b></td>
              <td>:</td>
              <td><label for="cat"></label>
             
           
              <?PHP 
			  
	
$get_problem = mysql_query("select distinct kategori from fls");
?>
              <select name="cat" id="cat"style="width:155px">
              <option selected="selected"></option>
                               <?php while($problem = mysql_fetch_array($get_problem)){ 
				?>
                <option><?php echo $problem['kategori']; ?></option>
                <?php } ?>    
              </select></td>
            </tr>
            <tr>
              <td><b>FLS</b></td>
              <td>:</td>
              <td> 
  
<?php		
 
	 
$get_status = mysql_query("select kode from fls");


?> 
                <select name="fls" id="fls"style="width:155px">
                  <option selected="selected"></option>
                  <?php while($status = mysql_fetch_array($get_status)){ ?>
                  <option>
                    <?php
		echo $status['kode']; ?>
                    </option>
                  <?php } ?>
                  </select></td>
              </tr>
                        
			 
            <tr>
              <td><b>Ticket</b></td>
              <td>:</td>
              <td><label for="tkt"></label>
                <input name="tkt" type="text" id="tkt" /></td>
              </tr>
            <tr align="center">
              <td colspan="3" bgcolor=""><input type="submit" value="Submit" />
                <input name="Reset" type="reset" value="Reset" />
                <input name="Batal" type="submit" id="Batal" value="Cancel" /></td>
              </tr>
            </table>
        </form></td>
      </tr>
    </table>
<?php     
include"FusionCharts/FC_Colors.php";
include"FusionCharts/FusionCharts_Gen.php";
include"FusionCharts/FusionCharts.php";
?>

<table width="left" border="1" bgcolor="#0033CC">
<tr>
<td>
<?php
echo"<div style='margin-left:0px;'><SCRIPT LANGUAGE='Javascript' SRC='FusionCharts/FusionCharts.js'></SCRIPT>";
	
	 $FC = new FusionCharts("Column3D","955","300"); 
	 $FC->setSWFPath("FusionCharts/");
	 
	 
	 $strParam="caption=Group Infrastruktur ; subcaption=; xAxisName=; yAxisName=; numberPrefix=; decimalPrecision=0";
	
	 $FC->setChartParams($strParam);
	 $qr=mysql_query("select* from fls where kategori='infra'"); 
	 while($fls=mysql_fetch_array($qr)){ 
	 $FC->addChartData("$fls[jumlah_tiket]","name=$fls[kode]");
	 
}	 	 

	$FC->renderChart();
echo"</div>";

?></td></tr>

<table border="1" bgcolor="#0033CC">
<tr>
<td>
<?php
echo"<div style='margin-left:0px;'><SCRIPT LANGUAGE='Javascript' SRC='FusionCharts/FusionCharts.js'></SCRIPT>";
	
	 $FC = new FusionCharts("Column3D","350","300"); 
	 $FC->setSWFPath("FusionCharts/");
	 
	 $strParam="caption=Group MI ; subcaption=; xAxisName=; yAxisName=; numberPrefix=; decimalPrecision=0";
	
	 $FC->setChartParams($strParam);
	 $qr=mysql_query("select* from fls where kategori='MI'"); 
	 while($fls=mysql_fetch_array($qr)){ 
	 $FC->addChartData("$fls[jumlah_tiket]","name=$fls[kode]");
	 	 	
}	 	 

	$FC->renderChart();
echo"</div>";
?>
</td>
<td>
<?php
	 $FC = new FusionCharts("Column3D","600","300"); 
	 $FC->setSWFPath("FusionCharts/");
	 
	 $strParam="caption=Group Pelaporan ; subcaption=; xAxisName=; yAxisName=; numberPrefix=; decimalPrecision=0";
	
	 $FC->setChartParams($strParam);
	 $qr=mysql_query("select* from fls where kategori='Pelaporan'"); 
	 while($fls=mysql_fetch_array($qr)){ 
	 $FC->addChartData("$fls[jumlah_tiket]","name=$fls[kode]");
}

	$FC->renderChart();
echo"</div>";
?></td>
</tr>

<table border="1" bgcolor="#0033CC">
<tr>
<td>
<?php
echo"<div style='margin-left:0px;'><SCRIPT LANGUAGE='Javascript' SRC='FusionCharts/FusionCharts.js'></SCRIPT>";
	
	 $FC = new FusionCharts("Column3D","550","300"); 
	 $FC->setSWFPath("FusionCharts/");
	 
	 $strParam="caption=Group Pembayaran ; subcaption=; xAxisName=; yAxisName=; numberPrefix=; decimalPrecision=0"; 
	
	 $FC->setChartParams($strParam);
	 $qr=mysql_query("select* from fls where kategori='Pembayaran'"); 
	 while($fls=mysql_fetch_array($qr)){ 
	 $FC->addChartData("$fls[jumlah_tiket]","name=$fls[kode]");
}	 	 

	$FC->renderChart();
echo"</div>";
?></td>
<td>
<?php
echo"<div style='margin-left:0px;'><SCRIPT LANGUAGE='Javascript' SRC='FusionCharts/FusionCharts.js'></SCRIPT>";
	
	 $FC = new FusionCharts("Column3D","450","300"); 
	 $FC->setSWFPath("FusionCharts/");
	 
	 $strParam="caption=Group Operator ; subcaption=; xAxisName=; yAxisName=; numberPrefix=; decimalPrecision=0"; 
	
	 $FC->setChartParams($strParam);
	 $qr=mysql_query("select* from operator where kategori='Operator'"); 
	 while($fls=mysql_fetch_array($qr)){ 
	 $FC->addChartData("$fls[jumlah_tiket]","name=$fls[kode_operator]");
}	 	 

	$FC->renderChart();
echo"</div>";
?></td>
</tr>
        <?php 
					if(isset($_REQUEST['jenis'])) {$jenis = $_REQUEST['jenis'];}
					if(isset($_REQUEST['search'])) {$search = $_REQUEST['search'];}
					else{$search="";}
					if($search == "")
					{
						$result = mysql_query("select * from fls ");
					}
					else
					{
						if($jenis == "Kode")
						{
							$result = mysql_query("select * from fls where kode='$search'");
						}
						else if($jenis == "Kategori")
						{
							$result = mysql_query("select * from fls where kategori='$search'");
						}
					}
					while($row = mysql_fetch_array($result)){
				?>
        
        <?php } ?>
    </table><?php
          $result = mysql_query("select * from operator");
		  while($row = mysql_fetch_array($result)){
		  ?>
        
    
      
         <?php } ?>

      </table>
    <p>&nbsp;</p></td>
  </tr>
   
  <tr>
    <td><table width="600" border="1" align="center">
      <tr>
        <td bgcolor="#999999" width="900">Data Operator</td>
        <td bgcolor="#999999"><table width="300" border="1">
          <tr>
            <td bgcolor="#999999" width="200"><strong>Total Tiket</strong></td>
            <?php
          $result = mysql_query("select distinct total_tiket from operator");
		  while($row = mysql_fetch_array($result)){
		  ?>
            <td bgcolor="#999999" width="200"><?php echo $row['total_tiket']; ?></td>
          </tr>
          <?php } ?>
        </table></td>
      </tr>
      <tr>
        <td bgcolor="#999999" width="300">Data FLS</td>
        <td bgcolor="#999999"><table width="300" border="1">
          <tr>
            <td bgcolor="#999999" width="200"><strong>Total Tiket</strong></td>
            <?php
          $result = mysql_query("select distinct total_tiket from fls");
		  while($row = mysql_fetch_array($result)){
		  ?>
            <td bgcolor="#999999" width="200"><?php echo $row['total_tiket']; ?></td>
          </tr>
          <?php } ?>
        </table></td>
      </tr>
      <tr>
        <td colspan="2" align="center" bgcolor="#999999"><strong>
         <?php
if ( $_SESSION [ 'username' ] == "admin" )
{
?>
<form method="post" name="hidden" action=<a><a href="NgilanginData.php">Reset Data</a></a></strong>
<?php
}
?></td>
        </tr>
        <td colspan="2" align="center" bgcolor="#999999"><strong><a href="logout.php">Logout</a></a></strong></td>
    </table>
      <p>&nbsp;</p>
      <strong><a href="NgilanginData.php"></a></strong><br/>
      <br/>
      <br/>
    <br/></td>
    
  </tr>
</table>
</body>
</html>
<?php
}
?>
<?php
}
?>


Lihat semua 2 jawaban

Silahkan login untuk menjawab!
Bung elixx mau mencari data siapa downline saya bagaimana yahh ?
maksudnya mirip seperti diagram dalam multi level marketing bung ? tabelnya
idmember | idparent \
01 -
02 01
03 01
04 02
05 02
begitu seterusnya terima kasih Bung

Lihat semua 1 jawaban

Silahkan login untuk menjawab!