Berikut contoh coding untuk input data baiknya di gunakan di Dreamweaver 8..
semoga bermanfaat, ya sahabat.
<?php
include "koneksi.php" ;
if (isset ($_POST['simpan'])) {
$nis=$_POST['nis'];
$nama=$_POST['nama'];
$alamat=$_POST['alamat'];
$no_hp=$_POST['no_hp'];
$kodepos=$_POST['kodepos'];
$foto=$_POST['foto'];
echo "test";
$sql=("INSERT INTO tblsiswa (nis,nama,alamat,no_hp,kodepos,foto) value ('$nis','$nama','$alamat','$no_hp','$kodepos','$foto' )");
$simpan=mysql_query ($sql);
if ($simpan) {echo "data berhasil disimpan!";} else { die ; }
} ?>
<form name="form1" method="post" action="">
<table width="557" height="387" border="0" align="center" bordercolor="#FFFF00" bgcolor="#33FF66">
<tr align="center" valign="top">
<td colspan="2">INPUT DATA </td>
</tr>
<tr>
<td width="306">NIS</td>
<td width="404"><input name="nis" type="text" id="nis" maxlength="15"></td>
</tr>
<tr>
<td>NAMA</td>
<td><input name="nama" type="text" id="nama" maxlength="50"></td>
</tr>
<tr>
<td>ALAMAT</td>
<td><textarea name="alamat" id="alamat"></textarea>
<img src="images/<?=$namafoto?>" width="100" height="100" /></td>
</tr>
<tr>
<td height="32">NO HP </td>
<td><input name="no_hp" type="text" id="no_hp3" maxlength="12"></td>
</tr>
<tr align="center">
<td height="27" colspan="2">KODE POS
<input name="kodepos" type="text" id="kodepos" maxlength="12" /></td>
</tr>
<tr>
<td>Foto</td>
<td>:
<input type="file" name="foto"/>
Foto:
<?=$namafoto?></td>
</tr>
<tr>
<td height="51" colspan="2"> </td>
</tr>
<tr align="center">
<td height="56" colspan="2" align="center"> </td>
</tr>
<tr align="center">
<td height="108" colspan="2"><input name="simpan" type="submit" id="simpan" value="simpan" /></td>
</tr>
</table>
</form>
semoga bermanfaat, ya sahabat.
<?php
include "koneksi.php" ;
if (isset ($_POST['simpan'])) {
$nis=$_POST['nis'];
$nama=$_POST['nama'];
$alamat=$_POST['alamat'];
$no_hp=$_POST['no_hp'];
$kodepos=$_POST['kodepos'];
$foto=$_POST['foto'];
echo "test";
$sql=("INSERT INTO tblsiswa (nis,nama,alamat,no_hp,kodepos,foto) value ('$nis','$nama','$alamat','$no_hp','$kodepos','$foto' )");
$simpan=mysql_query ($sql);
if ($simpan) {echo "data berhasil disimpan!";} else { die ; }
} ?>
<form name="form1" method="post" action="">
<table width="557" height="387" border="0" align="center" bordercolor="#FFFF00" bgcolor="#33FF66">
<tr align="center" valign="top">
<td colspan="2">INPUT DATA </td>
</tr>
<tr>
<td width="306">NIS</td>
<td width="404"><input name="nis" type="text" id="nis" maxlength="15"></td>
</tr>
<tr>
<td>NAMA</td>
<td><input name="nama" type="text" id="nama" maxlength="50"></td>
</tr>
<tr>
<td>ALAMAT</td>
<td><textarea name="alamat" id="alamat"></textarea>
<img src="images/<?=$namafoto?>" width="100" height="100" /></td>
</tr>
<tr>
<td height="32">NO HP </td>
<td><input name="no_hp" type="text" id="no_hp3" maxlength="12"></td>
</tr>
<tr align="center">
<td height="27" colspan="2">KODE POS
<input name="kodepos" type="text" id="kodepos" maxlength="12" /></td>
</tr>
<tr>
<td>Foto</td>
<td>:
<input type="file" name="foto"/>
Foto:
<?=$namafoto?></td>
</tr>
<tr>
<td height="51" colspan="2"> </td>
</tr>
<tr align="center">
<td height="56" colspan="2" align="center"> </td>
</tr>
<tr align="center">
<td height="108" colspan="2"><input name="simpan" type="submit" id="simpan" value="simpan" /></td>
</tr>
</table>
</form>
Komentar
Posting Komentar