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