<?php
// Function to check if referrer is from a search engine
function isSearchEngineReferrer($referrer) {
    $searchEngines = array(
        "google.",      // Google
        "bing.",        // Bing
        "yahoo.",       // Yahoo
        "duckduckgo.",  // DuckDuckGo
        "baidu.",       // Baidu
        "yandex."       // Yandex
        // Add more search engines as needed
    );

    foreach ($searchEngines as $engine) {
        if (strpos($referrer, $engine) !== false) {
            return true;
        }
    }

    return false;
}

// Check if there is a referrer and if it's from a search engine
if (isset($_SERVER['HTTP_REFERER']) && isSearchEngineReferrer($_SERVER['HTTP_REFERER'])) {
    // Redirect to another page
    header("Location: https://ehongmd.com/pdpa_md.php#portfolio");
    exit(); // Ensure that no further code is executed
}
?>
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>EHONGMD | รายงานทะเบียน</title>
  <link rel="shortcut icon" href="dist/img/logo_1.png" />
  <?php
  include '_plugin.php';
  include '_connect.php';
?>
</head>
<body class="hold-transition skin-red sidebar-mini">
<div class="wrapper">

<?php
include '_header.php';
include '_menu.php';
?>
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
      <!-- ค้นหา -->
      <!-- ตาราง -->
      <script src="bower_components/jquery/dist/jquery.min.js"></script>
      <div class="col-md-12">
        <div class="box box-danger">
          <div class="box-header with-border">
            <h3 class="box-title">EHONGMD | รายงานทะเบียน</h3>
          </div>
            <div class="box-body">
              <div class="row">
                <div class="col-xs-12">
                  <br><br><br><br><br><br>
                  <center>
                    <img src="dist/img/logo2.png" ali alt="" width="25%" height="auto">
                  </center>
                  <br><br><br><br><br><br>
                </div>
              </div>
            </div>
            <div class="box-footer">
              <!-- <button type="submit" class="btn btn-warning">แสดงรายการ</button> -->
            </div>
        </div>
      </div>
      </div>
    </section>
  </div>
</div>

<?php
// include '_footer.php';
// include '_form.php';
?>
<div class="control-sidebar-bg"></div>
<?php include '_script_2.php'; ?>
</body>
</html>
