63 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
		
		
			
		
	
	
			63 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
|   |       <link href="https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&display=swap" rel="stylesheet"> | ||
|  |       <link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet"> | ||
|  |       <!--Color Switcher Mockup--> | ||
|  |       <link href="css/color-switcher-design.css" rel="stylesheet"> | ||
|  |       <!-- Color Themes --> | ||
|  |       <link id="theme-color-file" href="css/color-themes/default-color.css" rel="stylesheet"> | ||
|  |       <link rel="shortcut icon" href="images/favicon.png" type="image/x-icon"> | ||
|  |       <link rel="icon" href="images/favicon.png" type="image/x-icon"> | ||
|  |       <!-- Responsive --> | ||
|  |      <meta name="360-site-verification" content="fe8d8c3da251df36a0252d7c2fd03d0f" /> | ||
|  |       <meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
|  |       <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> | ||
|  |       <!-- Stylesheets --> | ||
|  |       <link href="css/bootstrap.css" rel="stylesheet"> | ||
|  |       <link href="css/style.css" rel="stylesheet"> | ||
|  |       <link href="css/responsive.css" rel="stylesheet"> | ||
|  |        | ||
|  |        <?php include('../cms_admin/db_connection.php');?>
 | ||
|  |     | ||
|  |         <meta name="robots" content="index, follow"> | ||
|  |                         <?php | ||
|  |                                         // Fetch the first available record from the 'basi
 | ||
|  |                                         $fetch_query = "SELECT * FROM basic_info LIMIT 1"; | ||
|  |                                         $result = $conn->query($fetch_query); | ||
|  | 
 | ||
|  |                                         // Initialize variables to empty strings if no data is found
 | ||
|  |                                       $m_desc= $m_keywords= $m_title=$email = $phone = $facebook = $twitter = $linked_in = $instagram = $youtube = $tiktok = ''; | ||
|  | 
 | ||
|  |                                         if ($result->num_rows > 0) { | ||
|  | 
 | ||
|  |                                             $row = $result->fetch_assoc(); | ||
|  | 
 | ||
|  |                                              $m_title = $row['m_title']; | ||
|  |                                               $m_keywords = $row['m_keywords']; | ||
|  |                                                $m_desc = $row['m_desc']; | ||
|  |                                         } | ||
|  |                                         ?>
 | ||
|  |         <title> <?php echo $m_title;  ?></title>
 | ||
|  | 
 | ||
|  |                         <meta name="title" content="<?php echo $m_title; ?>"> | ||
|  |                            <meta name="description" content="<?php echo $m_desc; ?>"> | ||
|  |         <meta name="keywords" content="<?php echo $m_keywords; ?>"> | ||
|  |       | ||
|  |        | ||
|  |       <?php | ||
|  |       // Get the visitor's IP address
 | ||
|  |         $ip_address = $_SERVER['REMOTE_ADDR']; | ||
|  |         // Get the current date
 | ||
|  |         $current_date = date('Y-m-d'); | ||
|  |          | ||
|  |         // Prepare and execute the check query
 | ||
|  |         $check_query = "SELECT id FROM visitors WHERE ip = '$ip_address' AND date = '$current_date'"; | ||
|  |         $check_result = mysqli_query($conn, $check_query); | ||
|  |          | ||
|  |         if (mysqli_num_rows($check_result) == 0) { | ||
|  |             // If no matching IP and date, insert a new record
 | ||
|  |             $insert_query = "INSERT INTO visitors (ip, date) VALUES ('$ip_address', '$current_date')"; | ||
|  |             mysqli_query($conn, $insert_query); | ||
|  |         } | ||
|  |       ?>
 | ||
|  |        | ||
|  |   |