• 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

Implode array with array of glue strings

How to add automatically collapse/expand in content wordpress (single.php)?

Handle error for duplicate entries - PHP/MySQL

ORA-12546: TNS:permission denied error connection to remote oracle server

PHPUnit gives error: Target [IlluminateContractsViewFactory] is not instantiable

Not able to override collapsible.js in magento 2

How to disable only_full_group_by option in Laravel

Transpose multidimensional array and join values with commas

Symfony autowiring issues since docker update

jQuery Ajax Post with data

Get all WooCommerce products within own plugin

Custom add to cart button URL for specific product in WooCommerce?

Exception thrown during the rendering of a template("Parameter "id" for route "url" must match "[^/]++" ("" given) to generate a corresponding URL.")

Telegram bot doesn't answer

Insert database rows from columns of data from associative array of indexed arrays

About Contact Privacy policy Terms and conditions