<?php
function get_random_post_link() {


    // Get a random post
    $args = array(
        'post_type' => 'post',  // You can change the post type if needed
        'orderby'   => 'rand',
        'posts_per_page' => 1,
    );

    $random_post = get_posts($args);

    // Check if there are any random posts
    if ($random_post) {
        // Get the random post's permalink
        $post_link = get_permalink($random_post[0]->ID);
        return esc_url($post_link);
    } else {
        return '#';
    }
}

// Usage example:
$random_post_link = get_random_post_link();
?>

<br>
     <!-- ad code here --> 

<form name="tp" action="<?php echo $random_post_link; ?>" method="post">
    <input type="hidden" name="tp2" value="<?php echo $_COOKIE["tp"]; ?>">
    <center><button  id="btn6"  class="tp-btn tp-blue" style="display:none;">Continue</button>
    </center>
</form>

     <!-- ad code here --> 
    
 <br>


     
     
   
<script type="text/javascript">

function verify() {      
      document.getElementById('link').style.display = 'none';
          document.getElementById('tp-timex-btn').style.display = 'block';
        var count2 = 13; // Change the Timer from here
    var count2er = setInterval(timer2, 1300);
    function timer2() {
        count2 = count2 - 1;
        if (count2 <= 0) {
            
            document.getElementById('tp98').style.display = 'block';
             document.getElementById('tp-timex-btn').style.display = 'none';
       
            clearInterval(count2er);
            return;
        }
    
          document.getElementById("tp-time").innerHTML = count2;
    }
    
}

function timex() {
document.getElementById('tp98').style.display = 'none';
  document.getElementById('btnx').style.display = 'block';
  var count2x = 3; // Change the Timer from here
    var count2erx = setInterval(timer2x, 1300);
    function timer2x() {
        count2x = count2x - 1;
        if (count2x <= 0) {
            document.getElementById('btnx').style.display = 'none';
            document.getElementById('tp-text').style.display = 'block';
            document.getElementById('btn6').style.display = 'block';

             clearInterval(count2erx);
            return;
        }
        document.getElementById("tp-time").innerHTML = count2;
    }



}

</script>
