• 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

Get all WooCommerce products within own plugin

How to Generate PDF invoice to XML format using mPDF

Check If array is null or not in php

Laravel Nova, route not found

Sort a multidimensional array by integer inside of a string value which is two levels down

How to convert the int value to inch in PHP [closed]

Return multiple values from a function using mysqli_fetch_assoc [closed]

Laravel whole batch is cancelled if one Job fails

PDOException SQLSTATE[HY000] [2002] No such file or directory

Which is faster php date functions or carbon?

How to pass data to all views in Laravel 5?

JQuery content editable div and text box on submit not sending POST

PHP array, move keys and values to new array, but mix it up

How to install php yaml on CentOs?

Form repeater send wrong data with last element in Laravel

About Contact Privacy policy Terms and conditions