• 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

Inserting Country Selection into MySQL PHP [duplicate]

Load a .env file with PHP

TesseractOCR not working for Laravel

How to add a heading in between checkout fields of WooCommerce

Symfony 4: "Autowire: you should configure its value explicitly."

How to update array value in Laravel

Get orders by date and status woocommerce

Why do I have invalid argument supply for foreach in Laravel for json response? [duplicate]

Cannot pass null argument when using type hinting

Prestashop webservice API creating cart rules

Unable to guess the mime type as no guessers are available Laravel 5.2

laravel MVC execution flow

Display a success custom notice after Placing an Order in WooCommerce

Google Gmail API - How to login programatically?

PHP-Sort array based on another array?

About Contact Privacy policy Terms and conditions