maksud dan kegunaan dari mysql_real_escape_string() itu apanya, terus dari kegunaanya dalam keamanan web seberapa penting mysql_real_escape_string() itu.
sekalian minta contoh source code dan tutorialnya. buat saya pelajari lebih dalam. terima kasih.

Lihat semua 1 jawaban

Silahkan login untuk menjawab!
mas Ellyx, pada situs www.ais.uinjkt.ac.id memiliki cuplikan page souce code seperti yang tampil dibawah ini

<body>
<div id="uJvP_" class="z-temp"><div id="uJvPt" style="display:none"><ol><li>Gunakan browser Mozilla Firefox untuk hasil terbaik</li> <li>Khusus mahasiswa, demi alasan kemanan, segera ganti password lama anda</li> <li>Pada saat memasukkan biodata, masukkan alamat email secara lengkap, alamat email ini digunakan untuk melakukan verifikasi (misalnya lupa password)</li> <li>Jika terjadi masalah, harap segera hubungi puskom@uinjkt.ac.id</li> </ol></div>
</div>
<script type="text/javascript">zkmx(
[0,'uJvP_',{dt:'z_b3p',cu:'/ais',uu:'/ais/zkau',ru:'/login.zul'},[
['zul.wnd.Window','uJvP0',{$$onSize:false,$$onMaximize:false,$$onOpen:false,$$onMinimize:false,$$onZIndex:false,$onClose:true,$$onMove:false,width:'100%',height:'100%',prolog:'\n\n\t'},[
['zul.layout.Borderlayout','uJvP1',{height:'100%',style:'background:#f9fbff;',prolog:'\n\n\n\t\t\n\n\t\t'},[
['zul.layout.North','uJvP2',{id:'mycenter',$$onOpen:false,$$onSize:false,height:'80px',style:'border:0px;background:url(/ais/img/category-bg-2.png) repeat-x 0 0;background-color:#f9fbff;',border:'none'},[
]]],
['zul.layout.West','uJvP4',{$$onOpen:false,$$onSize:false,width:'300px',style:'background:#ffffff;',border:'none',flex:true,margins:'0,5,0,0'},[
['zul.wgt.Div','uJvP5',{},[
['zul.wnd.Panel','uJvP6',{$$onSize:false,$$onMaximize:false,$$onOpen:false,$$onMinimize:false,$$onZIndex:false,$onClose:true,$$onMove:false,width:'90%',height:'100%',style:'border:0px;',prolog:'\n\t\t\t\t\t'},[
['zul.wnd.Panelchildren','uJvP7',{style:'padding:5px;'},[
['zul.box.Box','uJvP8',{prolog:'\n\t\t\t\t\t\t\t'},[
],
['zul.wgt.Groupbox','uJvPa',{$$onOpen:false},[
['zul.wgt.Caption','uJvPw',{prolog:'\n\n\t\t\t\t\t\t\t\t\t'},[
],
]]],
['zhtml.Widget','f',{id:'f',prolog:'<form id="f" name="f" style="border:0px;background: transparent;" action="j_spring_security_check" method="POST">',epilog:'</form>'},[
['zul.grid.Grid','uJvPc',{$$onRender:true,$$onDataLoading:true,$$onInnerWidth:false,$$onPageSize:true,$$onScrollPos:false,width:'100%',style:'border:0px;background: transparent;',_topPad:0,emptyMessage:null,_totalSize:5,_offset:0},[
['zul.grid.Columns','uJvPd',{$$onColSize:false},[
],
]]],
['zul.grid.Rows','uJvPg',{_offset:0,visibleItemCount:5},[
['zul.grid.Row','uJvPh',{style:'border:0px;background: transparent;'},[
],
]]],
['zul.grid.Row','uJvPk',{style:'border:0px;background: transparent;'},[
],
]]],
['zul.grid.Row','uJvPn',{style:'border:0px;background: transparent;',spans:'2'},[
['zul.box.Box','uJvPo',{style:'border:0px;background: transparent;'},[
],
]],'horizontal']]],
['zul.grid.Row','uJvPr',{style:'border:0px;background: transparent;',spans:'2'},[
['zul.box.Box','uJvPs',{},[
]],'vertical']]],
['zul.grid.Row','uJvPu',{style:'border:0px;background: transparent;',spans:'2'},[
]]]]]]]]]]],
],
['zul.box.Box','uJvP_0',{id:'menubar1'},[
],
]],'vertical']],'vertical']]]]],
]]]]],
['zul.layout.Center','uJvP30',{$$onOpen:false,$$onSize:false,style:'background:#f9fcff;',flex:true},[
['zul.wgt.Include','uJvP40',{id:'iframe',width:'100%',height:'100%'},[
['zul.wnd.Window','uJvP50',{$onClose:true,width:'100%',height:'100%',style:'background-color: #FFFFFF;',prolog:'\n\n\t'},[
['zul.tab.Tabbox','uJvP60',{width:'100%',height:'100%',prolog:'\n\n\t\t'},[
['zul.tab.Tabs','uJvP70',{id:'mytabs'},[
]]],
['zul.tab.Tabpanels','uJvP90',{id:'mytabpanels'},[
['zul.tab.Tabpanel','uJvPa0',{},[
['zul.layout.Borderlayout','uJvPb0',{width:'100%',height:'100%',style:'border:0px;background: transparent;',prolog:'\n\t\t\t\t\t'},[
['zul.layout.North','uJvPc0',{id:'north',visible:false,style:'border:0px;background: transparent;'},[
['zul.box.Box','uJvPd0',{width:'100%',height:'50px',style:'border:0px;background: transparent;',align:'center',pack:'center'},[
],
],
,'trendy']],'horizontal']]],
['zul.layout.Center','uJvPh0',{id:'center',style:'border:0px;background: transparent;',flex:true},[
]]]]]]]]]]]]]]]]],
['zul.layout.South','uJvPj0',{$$onOpen:false,$$onSize:false,style:'background-color:#EDF0F8;'},[
['zul.box.Box','uJvPk0',{width:'100%',align:'center',pack:'center'},[
],
]],'horizontal']]]]],
]]],
]]],9);
var isInIFrame = (window.location != window.parent.location && window.name != 'main') ? true : false;if(isInIFrame){parent.location.reload();}
</script>
<noscript>
<div class="noscript"><p>Sorry, JavaScript must be enabled.<br/>Change your browser options, then <a href="">try again</a>.</p></div>
</noscript>

</body>


lantas bagaimanakan teknik atau cara untuk menghasilkan page source seperti ini?

Lihat semua 8 jawaban

Silahkan login untuk menjawab!
Permisi, Mau tanya nih om?
Gmna cara membuat database dengan user yang berbeda?
Contohnya hampir mirip seperti facebook.
Apakah saya harus membuat direktori per user, agar tiap user tidak bisa saling akses data user lain.

Lihat semua 3 jawaban

Silahkan login untuk menjawab!
mau tanya saya mau merandom opsi dari sebuah soal,
scrip tmpilnya gini
<?php
session_start();

include "../sessiontest.php";
	 
	 
	 include "main_function51.php";
	 include "delete.php";
	  include "insert.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>Soal 51</title>
<link rel="stylesheet" type="text/css" href="../css/accordion_glam.css" />
</head>
<Script type="text/javascript">
window.history.forward(1);
function check_input() {
  with ( document.forms.input ) {
    valid1 = new Array();
    // valid1ation code soal 1
	checked = false;
    for ( i = 0; !checked && ( i < document.forms["input"]["A5101"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5101"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 for ( i = 0; !checked && ( i < document.forms["input"]["A5102"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5102"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 for ( i = 0; !checked && ( i < document.forms["input"]["A5103"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5103"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 for ( i = 0; !checked && ( i < document.forms["input"]["A5104"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5104"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 for ( i = 0; !checked && ( i < document.forms["input"]["A5105"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5105"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 for ( i = 0; !checked && ( i < document.forms["input"]["A5106"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5106"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 for ( i = 0; !checked && ( i < document.forms["input"]["A5107"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5107"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 for ( i = 0; !checked && ( i < document.forms["input"]["A5108"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5108"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 for ( i = 0; !checked && ( i < document.forms["input"]["A5109"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5109"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 for ( i = 0; !checked && ( i < document.forms["input"]["A5110"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5110"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 for ( i = 0; !checked && ( i < document.forms["input"]["A5111"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5111"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 for ( i = 0; !checked && ( i < document.forms["input"]["A5112"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5112"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 for ( i = 0; !checked && ( i < document.forms["input"]["A5113"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5113"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 for ( i = 0; !checked && ( i < document.forms["input"]["A5114"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5114"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 for ( i = 0; !checked && ( i < document.forms["input"]["A5115"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5115"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	  for ( i = 0; !checked && ( i < document.forms["input"]["A5116"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5116"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5117"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5117"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5118"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5118"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5119"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5119"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5120"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5120"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5121"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5121"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5122"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5122"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5123"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5123"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5124"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5124"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5125"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5125"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5126"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5126"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5127"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5127"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5128"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5128"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5129"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5129"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5130"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5130"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5131"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5131"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5132"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5132"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5133"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5133"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5134"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5134"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5135"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5135"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5136"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5136"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5137"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5137"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5138"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5138"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5139"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5139"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5140"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5140"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5141"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5141"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5142"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5142"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5143"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5143"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5144"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5144"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5145"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5145"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5146"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5146"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5147"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5147"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5148"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5148"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5149"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5149"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5150"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5150"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	for ( i = 0; !checked && ( i < document.forms["input"]["A5151"].length ); i++ ) {
      checked = checked || ( document.forms["input"]["A5151"][ i ].checked == true );
    }
	valid1[ valid1.length ] = checked ? "true" : "";
	checked = false;
	 // alert results
    _clonefish_message = '';
    for ( i in valid1 )
      if ( ( valid1[ i ] != 'true' )  )
        _clonefish_message += "-" + valid1[ i ] + "\n";

    if ( _clonefish_message.length) {
      alert( "Ada Soal Yang Belum Dijawab Tolong di Lengkapi : ");
      return false;
    }
    else
      return true;
  }
}

</Script>
<div id="header">
<div class="shell">
<img src="../images/Logo-Equity.png" align="left" height="95"/></div>
</div><br />
<div id="test-accordion" class="accordion">
<div class="accordion-content">
<form action="finish.php" method="post"  name="input" onsubmit="return check_input();">
	<p><?php
		$i = 1;
		$soal=mysql_query("select * from tb_tampung WHERE ID_user = '".$_POST['iduser']."' ORDER BY RAND()");
		while ($data=mysql_fetch_array($soal))
		{
				
			
				echo $i.". ".$data["soal"]."<br>";
				?></p> 

                <table width="99%" height="77"  border="0">
                  <input type="hidden" name="iduser" value="<?php echo $_POST['iduser' ] ?>" />
                 <input type="hidden" name="nama" value="<?php echo $_POST['nama' ] ?>" />
                 <input type="hidden" name="tanggal" value="<?php echo $_POST['tanggal' ] ?>" />
                 <input type="hidden" name="bulan" value="<?php echo $_POST['bulan' ] ?>" />
                 <input type="hidden" name="tahun" value="<?php echo $_POST['tahun' ] ?>" />
                 <input type="hidden" name="alamat" value="<?php echo $_POST['alamat' ] ?>" />
                 <input type="hidden" name="jk" value="<?php echo $_POST['jk' ] ?>" />
                 <input type="hidden" name="email" value="<?php echo $_POST['email' ] ?>" />
                 <input type="hidden" name="kota" value="<?php echo $_POST['kota' ] ?>" />
                 <input type="hidden" name="notlpn" value="<?php echo $_POST['notlpn' ] ?>" />
                 <input type="hidden" name="kota" value="<?php echo $_POST['kota' ] ?>" />
                 <input type="hidden" name="propinsi" value="<?php echo $_POST['propinsi' ] ?>" />
                  <?php if($data['gambar'] != "") : ?>
					<tr>
                    <td align="center" valign="middle"></td>
                    <td width="45%" align="center" valign="middle"></a><img src="EquityTes/<?php echo $data['gambar'];?>" /></td>
                    <?php endif; ?>
                    <?php if($data['gambar2'] != "") : ?>
                    <td width="51%" align="center" valign="middle"></a><img src="EquityTes/<?php echo $data['gambar2'];?>" /></td>
                    </tr>
                 <?php endif; ?>
                 
                 
           //ada opsi di bawah ini yang saya mau random -->
                
                <tr>
                <td width="4%" align="center" valign="top"><input type="radio" name="A<?php echo $data["ID_soal"]; ?>" value="A" /></td>
                <td colspan="2" align="left" valign="top"><?php echo $data['jwb1']; ?></td>
                </tr>
                <tr>
                <td align="center" valign="top" ><input type="radio" name="A<?php echo $data["ID_soal"]; ?>" value="B" /></td>
          		<td colspan="2" align="left" valign="top" ><?php echo $data['jwb2']; ?></td>
                </tr>
                <?php if($data['jwb3'] != "") : ?>
				<tr>
       		<td height="23" align="center" valign="top" ><input type="radio" name="A<?php echo $data["ID_soal"]; ?>" value="X" /></td>
                  <td colspan="2" align="left" valign="top" ><?php echo $data['jwb3']; ?></td>
                  </tr>
                 <?php endif; rand();?> 
              //<---   akhir random opsi
                 </table>
                 <br />
                 
<?php
        $i++;
		}   
		?></p> 
         <table width="100%" border="0">
      <tr>
        <td width="90%">&nbsp;</td>
        <td width="10%"><input name="btnfinish" type="submit" value="Finish"/></td>
      </tr>
    </table>

</form>
</div></div>
</body>
</html>

Lihat semua 10 jawaban

Silahkan login untuk menjawab!
begini mas, saya punya 2 file php

form.php
<form action="link_history.php" method="post">
<input type="text"/>
<input type="submit" value="submit"/>
</form>

<?php
session_start();
?>

link_history.php
<script type="text/javascript">
alert("balik ke history");
window.history.back();
</script>

misal inputannya saya isi "abcd" trus saya submit.
lalu saya klik "balik ke history" kok inputannya malah kosong..?

kalo session_start() saya hapus.. trus saya coba lagi bisa mas..

kira2 gimana solusinya :(
saya pake mozilla 16.0.2
Silahkan login untuk menjawab!
Permisi para master, saya mau bertanya nih, saya buat input dinamis dengan menggunakan javascript, namun value di textfilednya baerasal dari perintah query dengan kata lain diambil dari tabel DB yang sudah ada.
untuk record pertama berhasil, namun ketika klik button tambah field, tidak muncul data yang dari tabel DB. ada yang bisa bantu gimana caranya nyisipin query tersebut di javascript.Terlampir code yang udah ane buat.
Mohon bantuannya, terimakasih para master :)
<html>
<head>
<script>
var idrow = 2;

function tambah(){
    var x=document.getElementById('datatable').insertRow(idrow);
    var td1=x.insertCell(0);
    var td2=x.insertCell(1);
    var td3=x.insertCell(2);
    var td4=x.insertCell(3);
	var td5=x.insertCell(4);
	
    //td1.innerHTML="<input type='tex't name='idkaryawan[]'>";
	td1.innerHTML="<select name='prdId[]'><option>-------</option><option>Perempuan</option></select>"; //diharapkan query php bisa di sisipkan disini
        td2.innerHTML="<input type ='text' name='nama[]'>";
        td3.innerHTML="<select name='sex[]'><option>Laki-laki</option><option>Perempuan</option></select>";
        td4.innerHTML="<input type ='text' name='email[]'>";
	td5.innerHTML="<input type ='date' name='date[]'>";
	
    idrow++;
}

function hapus(){
    if(idrow>2){
        var x=document.getElementById('datatable').deleteRow(idrow-1);
        idrow--;
    }
}
</script></head>
<body>
<form action=prosesdatakaryawan.php method=post>
<table id=datatable border=0>
<tr bgcolor=#ababab>
<td>ID Karyawan</td>
<td>Nama</td>
<td>Jenis Kelamin</td>
<td>Email</td>
<td>Tanggal</td>
</tr>
<tr>
<td>
//query memanggil data dari database
<?php
$result = mysql_query("select * from partner");
$jsArray = "var prdName = new Array();\n";
echo '<select name="prdId[]" onchange="document.getElementById(\'prd_name\').value = prdName[this.value]">';
echo '<option>-------</option>';
while ($row = mysql_fetch_array($result)) {
    echo '<option value="' . $row['id_partner'] . '">' . $row['id_partner'] . '</option>';
    $jsArray .= "prdName['" . $row['id_partner'] . "'] = '" . addslashes($row['partnername']) . "';\n";
}
echo '</select>';
?>

</td>
<td><input type='text' name='nama[]' id='prd_name'/>
<script type='text/javascript'>
<?php echo $jsArray; ?>
</script></td>
<td><select name='sex[]'><option>Laki-laki</option><option>Perempuan</option></select></td>
<td><input type ='text' name='email[]'></td>
<td><input type ='date' name='date[]'></td>
</tr>
</table>
<input type=button value=tambah onclick=tambah()>
<input type=button value=delete onclick=hapus()
<br>
<input type=submit>
</form>
</body>
</html>
Silahkan login untuk menjawab!