• 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

Laravel 5 issue with wherePivot

Laravel passport auth token not working after moving to different server

Is there a way to correctly use sanitize_text_field and wp_unslash that doesn't cause psalm to error with "expects string, possibly different type"

No definition found for function in vendor vscode

Filter WooCommerce products with post__in and additional meta queries

MySQL/PHP - Web Based Game -User specific inventory table or 1 giant table? Another option?

auth pages not getting css in laravel

Laravel phpunit test failing authorization

get folder directory from input type file - PHP

How to identify whether webp image is static or animated?

What is the difference between client-side and server-side programming?

Refresh specific HTML content that retrieves data from MySQL

PHP block shortcut in Visual Studio Code

PHP array slice from position + attempt to return fixed number of items

Zig-zag scan an N x N array

About Contact Privacy policy Terms and conditions