connect_error) { die("Connection failed: " . $conn->connect_error); } preg_match("/[^\.\/]+\.[^\.\/]+$/", $_SERVER['SERVER_NAME'], $thisDomain); // === load4.me $mySubDomain = explode('.', $_SERVER['HTTP_HOST']); // === st $sql = "SELECT * FROM `domains` WHERE `id` = '".$thisDomain[0]."';"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $main_domain = $row["main_domain"]; $domain_name = $row["domain_name"]; $js_url = $row["js_url"]; $css_url = $row["css_url"]; $img_url = $row["img_url"]; $doc_url = $row["doc_url"]; $domain_id = $row["id"]; //print_r($row); } } if(count($mySubDomain) == 2){ // IT IS A MAIN DOMAIN $domainContent = "main"; $user_state = "State"; $user_state_abb = "ST"; $user_state_posiv = "State's"; $user_state_dl_office = "Driver License Office"; $user_stSeal = "notSet"; $user_dlHandbookImg = "notSet"; $user_cycHandbookImg = "notSet"; $user_cdlHandbookImg = "notSet"; $user_dlHandbookDoc = "notSet"; $user_cycHandbookDoc = "notSet"; $user_cdlHandbookDoc = "notSet"; $user_st_website = "notSet"; } else{ // IT IS A SUB-DOMAIN $domainContent = "sub"; $sql = "SELECT * FROM `state_details` WHERE `state_abb` = '".$mySubDomain[0]."';"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $user_state = $row["state"]; $user_state_abb = $row["state_abb"]; $user_state_posiv = $row["state_posiv"]; $user_state_dl_office = $row["state_dl_office"]; $user_stSeal = $row["stSeal"]; $user_dlHandbookImg = $row["dlHandbookImg"]; $user_cycHandbookImg = $row["cycHandbookImg"]; $user_cdlHandbookImg = $row["cdlHandbookImg"]; $user_dlHandbookDoc = $row["dlHandbookDoc"]; $user_cycHandbookDoc = $row["cycHandbookDoc"]; $user_cdlHandbookDoc = $row["cdlHandbookDoc"]; $user_st_website = $row["st_website"]; if(!isset($_COOKIE["State"]) || $_COOKIE["State"] != $user_state){ $arr_cookie_options = array ( 'expires' => time() + 86400 * 365, 'path' => '/', 'domain' => '.'.$thisDomain[0], // leading dot for compatibility or use subdomain 'secure' => true, // or false 'httponly' => true, // or false 'samesite' => 'None' // None || Lax || Strict ); setcookie('State', $user_state, $arr_cookie_options); setcookie('StateURL', strtolower($user_state_abb).".".$thisDomain[0], $arr_cookie_options); } } } } ?>connect_error) { die("Connection failed: " . $conn->connect_error); } $sql = "SELECT * FROM `test_specs` WHERE `test_name` = 'pretrip'"; $result = $conn->query($sql); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) { $dbTest = $row["test"]; // Combination_Vehicles $dbTestName = $row["test_name"]; // comb_vehicles $dbName = $row["name"]; // Combination Vehicles Test $dbQuest = $row["qust"]; // 30 $dbRecords = $row["records"]; // 106 $dbInfo = $row["info"]; // The combination endorsement allows you to drive } } $testName = $dbName; $testDB = $dbTestName; $testSize = $dbRecords; $random_number_array = range(1, $testSize); shuffle($random_number_array ); $arr = $random_number_array; $newArray = array_slice($arr, 0, $dbQuest); $myArray = htmlspecialchars(serialize($newArray)); ?>

";}?>CDL Pretrip Test