<?php
include "koneksi.php";
$username1 = $_POST['username1'];
$password1 = $_POST['password1'];
if(empty($username1)){
echo "<script>alert('Username belum diisi')</script>";
echo "<meta http-equiv='refresh' content='1 url=daftar.html'>";
}else 
if (empty($password1)){
echo "<script>alert('Password belum diisi')</script>";
echo "<meta http-equiv='refresh' content='1 url=daftar.html'>";
}else{
$daftar = mysql_query("INSERT INTO user (username1,password1) values ('$username','$password')");
if ($daftar){
echo "<script>alert('Berhasil Mendaftar')</script>";
echo "<meta http-equiv='refresh' content='1 url=daftar.html'>";
}else{
echo "<script>alert('Gagal Mendaftar')</script>";
echo "<meta http-equiv='refresh' content='1 url=daftar.html'>";
}
}
?>