/home/mip/public_html_/old-website/login.php
<?
require_once("func_proc.php");

$db=db_connect();

if (!$db) {
	echo "<center> Error connecting to database. </center>\n";
	exit;
}

if ($table = login($username,$password)){
	$result = getdata("Select applicant_id from ".$table." where email='$username' and password='$password'");
	header ("Location: apply_online.php?action=update&table=$table&applicant_id=".$result[1][applicant_id]."");
	exit;
}else{
	header("Location: applicant_login.php?active1=jobs&username=$username&msg=Sorry no existing record matches your input. Please check if your details are correct and try again.");
}
?>