<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>belajar form</title>
<link rel="stylesheet" href=<?php echo "/aqil_web/style.css" ?>>
</head>
<body>
<h1>Form Registrasi</h1>
<div>
<form action="proses.php" method="POST">
<fieldset>
<legend align="">Biodata Santri</legend>
<p>
<label for="nama"> Nama : </label>
<input type="text" name="nama" id="nama">
</p>
<p>
<label for="nim"> NIM : </label>
<input type="text" name="nim" id="nim">
</p>
<p>
<label for="tgl"> Tanggal Lahir : </label>
<select name="tgl" id="tgl">
<?php
for ($i = 1; $i <= 31; $i++) {
echo "<option value =$i>";
echo str_pad($i, 2, "0", STR_PAD_LEFT);
echo "</option>";
}
?>
</select>
<select name="bln" id="bln">
<option value="Januari">Januari</option>
<option value="Februari">Februari</option>
<option value="Maret">Maret</option>
<option value="April">April</option>
<option value="Mei">Mei</option>
<option value="Juni">Juni</option>
<option value="Juli">Juli</option>
<option value="Agustus">Agustus</option>
<option value="September">September</option>
<option value="Oktober">Oktober</option>
</option>
<option value="Nopember">Nopember</option>u</option>
<option value="Desember">Desember</option>u</option>
</select>
<select name="thn" id="thn">
<?php
for ($i = 1980; $i <= 2020; $i++) {
echo "<option value =$i>$i</option>";
}
?>
</select>
</p>
<p><label for="alamat">Alamat : </label>
<textarea name="alamat" id="alamat" cols="22" rows="5"></textarea></p>
<p>
<label for="">Jenis Kelamin : </label>
<label for=""><input type="radio" name="jk" value="laki2">Laki-laki </label>
<label for=""><input type="radio" name="jk" value="perempuan">Perempuan </label>
</p>
</fieldset>
<fieldset>
<legend align="">User Account</legend>
<p>
<label for="username"> Username</label>
<input type="text" name="username" id="username">
</p>
<p>
<label for="email"> Email</label>
<input type="text" name="email" id="email">
</p>
<p>
<label for="pass"> Password</label>
<input type="password" name="password" id="nama">
</p>
<p>
<label for="repass"> Ulangi Password</label>
<input type="password" name="repassword" id="repass">
</p>
</fieldset>
<fieldset>
<legend align="">Resolusi Tahun Ini</legend>
<p>
<input type="checkbox" name="target1" value="HTML" id="html">
<label for="html"> Menguasai HTML</label>
</p>
<p>
<input type="checkbox" name="target2" value="CSS" id="css">
<label for="css"> Paham CSS</label>
</p>
<p>
<input type="checkbox" name="target3" value="PHP" id="php">
<label for="php"> Mastering PHP</label>
</p>
</fieldset>
<p><input type="submit" value="kirim data" name="submit"></p>
</form>
</div>
</body>
</html>
<?php
if (!isset($_POST["submit"])) {
header("Location: index.php");
die();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>proses</title>
</head>
<body>
<h1>Halaman Proses</h1>
<?php
echo "Nama : " . $_POST["nama"] . "<br>";
echo "NIM : " . $_POST["nim"] . "<br>";
echo "Tanggal Lahir : " . str_pad($_POST["tgl"], 2, "0", STR_PAD_LEFT) . " " . $_POST["bln"] . " " . $_POST["thn"] . "<br>";
echo "Alamat : " . $_POST["alamat"] . "<br>";
if (isset($_POST["jk"])) {
echo "Jenis Kelamin :" . $_POST["jk"] . "<br>";
}
echo "Password : " . $_POST["password"] . "<br>";
echo "Konfirmasi Password " . $_POST["nim"] . "<br>";
if (isset($_POST["target1"])) {
echo "Target1 :" . $_POST["target1"] . "<br>";
}
if (isset($_POST["target2"])) {
echo "Target2 :" . $_POST["target2"] . "<br>";
}
if (isset($_POST["target3"])) {
echo "Target3 :" . $_POST["target3"] . "<br>";
}
?>
</body>
</html>