Error message

User warning: The following theme is missing from the file system: responsive_green. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1143 of /var/www/moscovie.com/includes/bootstrap.inc).

Разработать счетчик посетителей, который будет писать информацию о каждом посетителе, 1 раз в день


//Решение
$visitCounter = 0;

if(isset($_COOKIE['visitCounter']))
$visitCounter = $_COOKIE['visitCounter'];

$visitCounter++;
$lastVisit = '';

if(isset($_COOKIE['lastVisit']))
$lastVisit = date('d-m-Y H:i:s',$_COOKIE['lastVisit']);

//Проверка на запись каждый день
if(date('d-m-Y',$_COOKIE['lastVisit']) != date('d-m-Y')){
setcookie('lastVisit',time(),0x7FFFFFFF);
setcookie('visitCounter',$visitCounter,0x7FFFFFFF);
}

//$lastVisit
//$visitCounter

Категория: 
The code has been tested and works
Мультитег: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.