<!DOCTYPE html>
<html lang="en">
<head>
<title>>> FORM LOGIN <<</title>
</head>
<body bgcolor="#8062f0">
<font face="cambria">
<h3>:: Sign Up Form ::</h3>
<?php
if($_POST){
$nama = $_POST['nama'];
$email = $_POST['email'];
$alamat = $_POST['alamat'];
$kota = $_POST['kota'];
$kode = $_POST['kode'];
$error = array();
if(empty($nama)){
$error['nama'] = '>> isikan nama Anda !!';
}
if(empty($email)){
$error['email'] = '>> isikan alamat email !!';
}
if(empty($alamat)){
$error['alamat'] = '>> alamat tdk blh kosong';
}
if(empty($kota)){
$error['kota'] = '>> kota tdk blh kosong';
}
if(empty($kode)){
$error['kode'] = '>> isikan kode pos kota';
}
if(empty($error)){
}
}
?>
<form action="<?php $_SERVER['PHP_SELF'];?>" method="post">
Nama :
<br>
<input type="text" name="nama" value="<?php echo isset($_POST['nama']) ? $_POST['nama'] : '';?>" />
<div style="color:black"><?php echo isset($error['nama']) ? $error['nama'] : '';?></div>
<br>
Email :
<br>
<input type="text" name="email" value="<?php echo isset($_POST['email']) ? $_POST['email'] : '';?>" />
<div style="color:black"><?php echo isset($error['email']) ? $error['email'] : '';?></div>
<br>
Alamat :
<br>
<input type="text" name="alamat" value="<?php echo isset($_POST['aamat']) ? $_POST['alamat'] : '';?>" />
<div style="color:black"><?php echo isset($error['alamat']) ? $error['alamat'] : '';?></div>
<br>
Kota :
<br>
<input type="text" name="kota" value="<?php echo isset($_POST['kota']) ? $_POST['kota'] : '';?>" />
<div style="color:black"><?php echo isset($error['kota']) ? $error['kota'] : '';?></div>
<br>
Kode Pos :
<br>
<input type="text" name="kode" value="<?php echo isset($_POST['kode']) ? $_POST['kode'] : '';?>" />
<div style="color:black"><?php echo isset($error['kode']) ? $error['kode'] : '';?></div>
<br>
<input type="submit" value="proses" />
</form>
</body>
</html>
B. Output
Tidak ada komentar:
Posting Komentar