• Categories
    • PHP
    • phpMyAdmin
    • PHPMailer
    • FFMpeg
    • PHPEXcel
    • PHPDoc
    • PHPUnit
    • CakePHP
    • CakePHP 2.0
    • Cake PHP 2.1
    • CakePHP Model
    • Facebook PHP SDK
    • composer-php
    • PHP 7
    • PHP GD
    All Categories
  • About

Execute only one time and then wait set period of time before executing again

javascriptphpjquerycookies


PHP Snippet 1:

<?php

if(isset($_COOKIE['yourCookieName'])){
   //Do nothing
} else {
   $cookie_name = "yourCookieName";
   $cookie_value = "set";
   setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); // 86400 = 1 day
   ?>
    //Break out of php and run your javascript here
   <?php 
}
?>

Related Snippets

Accessors (Getter) & Mutators (Setter) On a Pivot Table in Laravel

Why the name of trucks are same in 2nd and 3rd record of company data retrieval?

Why rand() every time I refresh the page?

How to get result of the formula on import xlsx with maatwebsite using Laravel? I get formula and not value of the formula

Get WooCommerce products from specific category

How to Make Laravel Eloquent "IN" Query?

How do I Post to .txt document before form submits

file_get_contents() without "Http" to access external URL [closed]

Google API Heatmap Layer exception, why?

Comma separated list from array with "and" before last element

Add a custom text for a particular product on specific email notification in Woocommerce

java URL working on browser but not in client program

How to load Codeigniter 4 lang file into an array variable

enroll_table three field fetch to payment form to create payment field in laravel 5.5

Send same name multiple checkbox values via ajax

About Contact Privacy policy Terms and conditions