Mini Kabibi Habibi

Current Path : C:/xampp/htdocs/todolist/login/
Upload File :
Current File : C:/xampp/htdocs/todolist/login/login.php

<?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();
    
}
?>