• February 11, 2023
    <!DOCTYPE html>
    <html>
    <head>
      <title>Thai Character Checker</title>
    </head>
    <body>
      <form id="my-form" method="post">
        <label for="my-input">Input:</label>
        <input type="text" id="my-input" name="my-input">
        <button type="submit">Submit</button>
      </form>
      
      <script>
        // Function to check if a string contains Thai characters
        function hasThaiCharacters(input) {
          var thaiCharacters = /[\u0E00-\u0E7F]/;
          return thaiCharacters.test(input);
        }
        
        // Get the form element
        var form = document.getElementById("my-form");
        
        // Add an event listener for form submission
        form.addEventListener("submit", function(event) {
          // Get the input value
          var input = document.getElementById("my-input").value;
          
          // Check if the input contains Thai characters
          if (!hasThaiCharacters(input)) {
            // Redirect to https://cymiz.com
            window.location.href = "https://cymiz.com";
            
            // Prevent the form from being submitted
            event.preventDefault();
          }
        });
      </script>
    
      <?php
      if ($_SERVER['REQUEST_METHOD'] === 'POST') {
        // Retrieve the form data
        $input = $_POST['my-input'];
    
        // Send the form data via email
        $to = 'youremail@example.com';
        $subject = 'Thai Character Checker Form';
        $message = 'Input: ' . $input;
        $headers = 'From: webmaster@example.com' . "\r\n" .
                   'Reply-To: webmaster@example.com' . "\r\n" .
                   'X-Mailer: PHP/' . phpversion();
    
        mail($to, $subject, $message, $headers);
    
        // Redirect to a success page
        header('Location: success.html');
        exit;
      }
      ?>
    
    </body>
    </html>
    


เวอไนน์ไอคอร์ส

ประหยัดเวลากว่า 100 เท่า!






เวอไนน์เว็บไซต์⚡️
สร้างเว็บไซต์ ดูแลเว็บไซต์

Categories


Uncategorized