Mini Kabibi Habibi
<?php
$server = "localhost";
$username = "root";
$password = "";
$dbname = "personnel";
$conn = mysqli_connect($server,$username,$password,$dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if (!mysqli_select_db($conn, $dbname)) {
die("Uh oh, couldn't select database --> $dbname" . $conn->connect_error . ' >');
}
if(isset($_POST['REGISTER'])) {
if (!empty($_POST['nam']) && !empty($_POST['email']) && !empty($_POST['mobile']) && !empty($_POST['add']) && !empty($_POST['city']) && !empty($_POST['region']) && !empty($_POST['country']) && !empty($_POST['postal']) && !empty($_POST['gender']) && !empty($_POST['civilstats']) && !empty($_POST['age']) && !empty($_POST['bday']) && !empty($_POST['bplace']) && !empty($_POST['pagibig']) && !empty($_POST['philhealth']) && !empty($_POST['tinnum']) && !empty($_POST['accountnum']) && !empty($_POST['plantilla']) && !empty($_POST['empstats']) && !empty($_POST['position']) && !empty($_POST['sal']) && !empty($_POST['stip']) && !empty($_POST['desigarea']) && !empty($_POST['empnature']) && !empty($_POST['itnumber']) && !empty($_POST['pass'])){
$nam = $_POST['nam'];
$email = $_POST['email'];
$mobile = $_POST['mobile'];
$add = $_POST['add'];
$city = $_POST['city'];
$region = $_POST['region'];
$country = $_POST['country'];
$postal = $_POST['postal'];
$gender = $_POST['gender'];
$civilstats = $_POST['civilstats'];
$age = $_POST['age'];
$bday = $_POST['bday'];
$bplace = $_POST['bplace'];
$pagibig = $_POST['pagibig'];
$philhealth = $_POST['philhealth'];
$tinnum = $_POST['tinnum'];
$accountnum = $_POST['accountnum'];
$platilla = $_POST['platilla'];
$empstats = $_POST['empstats'];
$position = $_POST['position'];
$sal = $_POST['sal'];
$step = $_POST['step'];
$desigarea = $_POST['desigarea'];
$empnature = $_POST['empnature'];
$itnumber = $_POST['itnumber'];
$pass = $_POST['pass'];
$sql = "INSERT INTO employee (`ITEM_NUM`,`PASSWORD`,`NAM,EMAIL`,`MOBILE`,`ADDRESS`,`CITY`,`REGION`,`COUNTRY`,`POSTAL_CODE`,`GENDER`,`AGE`,`BIRTH_DATE`,`BIRTH_PLACE`,`PAGIBIG`,`TIN`,`LBP`,`PLANTILLA`,`EMP_STATUS`,`POSITION`,`SALARY`,`STEP`,`DESIGNATION`,`NATURE`,`CIVIL_STATS`) VALUES ('".$itnumber."','".$pass."','".$nam."','".$email."','".$mobile."','".$add."','".$city."','".$region."','".$country."','".$postal."','".$gender."','".$age."','".$bday."','".$bplace."','".$pagibig."','".$philhealth."','".$tinnum."','".$accountnum."','".$plantilla."','".$empstats."','".$position."','".$sal."','".$step."','".$desigarea."','".$empnature."','".$civilstats."')";
$run = mysqli_query($conn,$sql) or die(mysqli_error());
echo "form submitted successfully";
}
}
?>