Contoh membuat form sederhana di 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>DATA MAHASISWA</title>
</head>
<body>
<form id="form1" name="Form_Mahasiswa" method="post" action="insert.php">
<table width="500" border="0" align="center">
<tr>
<th colspan="2" bgcolor="#336600">
<font color="#FFFF00">DATA MAHASISWA</font></th>
</tr>
<tr>
<td width="198">NIM</td>
<td width="292"><input name="nim" type="text" id="nim" maxlength="10" /></td>
</tr>
<tr>
<td>NAMA</td>
<td><input name="nama" type="text" id="nama" maxlength="30" /></td>
</tr>
<tr>
<td>TEMPAT</td>
<td><input name="tempat" type="text" id="tempat" maxlength="30" /></td>
</tr>
<tr>
<td>TANGGAL LAHIR</td>
<td>Tgl
<select name="tgl" id="select">
<?php
for ($tgl=1;$tgl<=31;$tgl++){
echo "<option value=$tgl>$tgl</option>";
}
?>
</select>
Bln
<select name="bln" id="select2">
<?php
for ($bln=1;$bln<=12;$bln++){
echo "<option value=$bln>$bln</option>";
}
?>
</select>
Thn
<select name="thn" id="select3">
<?php
for ($thn=1990;$thn<=2010;$thn++){
echo "<option value=$thn>$thn</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>JENIS KELAMIN</td>
<td><input type="radio" name="gender" id="radio" value="Pria" />
Pria
<input type="radio" name="gender" id="radio2" value="Wanita" />
Wanita</td>
</tr>
<tr>
<td>ALAMAT</td>
<td><textarea name="alamat" id="alamat" cols="45" rows="5"></textarea></td>
</tr>
<tr>
<td>TELEPON</td>
<td><input name="tlp" type="text" id="tlp" maxlength="12" /></td>
</tr>
<tr>
<td colspan="2" bgcolor="#336600" align="center">
<input type="submit" name="btnSimpan" id="button" value="Simpan" />
<input type="reset" name="btnReset" id="button2" value="Reset" />
</td>
</tr>
</table>
</form>
<center>
<a href="Tampil_Data.php"> << Tampil Data >> </a>
</center>
</body>
</html>
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar