I am using this code to submit my form
$('.login-form input').keypress(function (e) {
if (e.which == 13) {
if ($('.login-form').validate().form()) {
//$( "#login-form input" ).submit();
// window.location.href = "check.php";
$.post("check.php", $("#login-form input").serialize(), function(data) {
window.location.href = "check.php";
});
}
return false;
}
});
I am not able to get values in check.php. kindly help me. I know its a basic thing but I am not able to do this. Thanks in advance
Here is my php code
<?php
session_start();
include_once("Includes/db_connection.php");
include_once("participant/welcome.php");
include_once("admin/admin_login.php");
include_once("staff/staff_login.php");
include_once("lecturer/lecturer_login.php");
include("Includes/location.php");
//include("Includes/lecturer_data_dropdown.php");
$username=$_POST["username"];
$password=$_POST["password"];
echo $username;
if($_POST["user_type"]=="participant")
{
participant($password);
}
elseif($_POST["user_type"]=="admin")
{
admin($username, $password);
}
elseif($_POST["user_type"]=="staff")
{
staff($username, $password);
}
elseif($_POST["user_type"]=="lecturer")
{
lecturer($username, $password);
}
?>
Here i just need usertype, username and password to make login decisions