• 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

woocommerce change position of price

NGINX: connect() to unix:/var/run/php7.2-fpm.sock failed (2: No such file or directory)

Get keys from associative array [duplicate]

Laravel phpunit test failing authorization

Results page in other window

Laravel Command Schedule Not Working Properly

How do I Post to .txt document before form submits

Symfony redirect if already loggedin from login page

How to fix 'Data has already been sent to output, unable to output PDF file' in MPDF

Xdebug in Laravel is not working with VSCode

PHPExcel export HTML table to xlsx

How Can I Do LIMIT 1, 2 In WP_Query

Get sql.h error on MacOS 12 (Monterey) sqsrv and pdo_sqsrv drive installation

How to send upload image through email

Add Metadata, headers (Expires, CacheControl) to a file uploaded to Amazon S3 using the Laravel 5.0 Storage facade

About Contact Privacy policy Terms and conditions