session_start();
$serverName = "147.93.110.26"; //serverName\instanceName
$connectionInfo = array( "Database"=>"bdlmstest", "UID"=>"bdlmsdbuser", "PWD"=>"Fdr&123vdbvdr#2");
$con = sqlsrv_connect($serverName, $connectionInfo);
// Check connection
if (!$con) {
echo "Failed to connect:
";
if (($errors = sqlsrv_errors()) != null) {
foreach ($errors as $error) {
echo "SQLSTATE: " . $error['SQLSTATE'] . "
";
echo "Code: " . $error['code'] . "
";
echo "Message: " . $error['message'] . "
";
}
}
exit; // Stop executing if the database is down
}
//$con = mysqli_connect("77.68.8.133","bdlms","MI!2XgLl*Xg_i6QKs3bf","bdlms","3306");
// Check connection
//if (mysqli_connect_errno())
//{
//echo "Failed to connect to MySQL: " . mysqli_connect_error();
//}
//mysqli_query($con, "SET SESSION sql_mode = 'TRADITIONAL'");
//$moodleUrl = 'https://training.bluedartaviation.com/lmsbd/';
//$portalUrl = 'https://training.bluedartaviation.com';
date_default_timezone_set("Asia/Kolkata");
$moodleUrl = 'https://khaki-panther-370925.hostingersite.com/lmsbd/';
$portalUrl = 'https://khaki-panther-370925.hostingersite.com/';
$GLOBALS['adminAccount'] = '1';
$GLOBALS['employerAccount'] = '2';
$GLOBALS['orgAdmin'] = '3';
$GLOBALS['trialAccount'] = '4';
$GLOBALS['individualAccount'] = '5';
define('SMTP_HOST', 'gmail.avaiation.net');
define('SMTP_USER', 'TEGTY@hotmail.com');
define('SMTP_PASSWORD', 'ABCD1452uyH');
define('SMTP_PORT', '1475');
define('FROM_EMAIL', 'TEGTY@hotmail.com');
define('FROM_NAME', 'TEGTY@hotmail.com');
$ccsymbol = array('pricegbp'=>'£', 'priceeuro'=>'€', 'priceusd'=>'$');
$siteFromemail = " TEGTY@hotmail.com";
header("X-Frame-Options: DENY");
setcookie("user_session", "random_session_id", [
"expires" => time() + 3600, // 1 hour expiration
"path" => "/",
"domain" => "https://training.bluedartaviation.com",
"secure" => true, // Only send over HTTPS
"httponly" => true, // Prevent access by JavaScript
"samesite" => "Strict" // Prevent CSRF attacks
]);
// Start session securely
session_set_cookie_params([
"lifetime" => 0, // Session expires when browser closes
"path" => "/",
"domain" => "https://training.bluedartaviation.com",
"secure" => true, // HTTPS only
"httponly" => true, // Prevent JavaScript access
"samesite" => "Strict" // CSRF protection
]);
if(isset($_SESSION["login_time_stamp"])){
if(time()-$_SESSION["login_time_stamp"] > 2880) {
session_destroy();
session_start(); // Start a new session
// Optional: Regenerate the session ID to prevent session fixation attacks
session_regenerate_id(true);
header("Location:https://khaki-panther-370925.hostingersite.com/lmsbd/login/logout.php?sesskey".$_SESSION['msesskey']);
}
}