Mini Kabibi Habibi
<?php
if (isset($_POST['uname']) && isset($_POST['password'])) {
function validate($data){
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
$uname = validate($_POST['uname']);
$password = validate($_POST['password']);
if (empty($uname)) {
header("Location: index.php?error=User Name is Required");
exit();
}else if(empty($password)) {
header("Location: index.php?error=Password is Required");
exit();
}
header("Location: home.php");
exit();
}
?>