PHP Classes

File: samples/click.php

Recommend this page to a friend!
  Classes of Joseluis Laso  >  PHP Stats Graphs  >  samples/click.php  >  Download  
File: samples/click.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Stats Graphs
Generate SVG charts from sample data
Author: By
Last change:
Date: 5 years ago
Size: 383 bytes


Class file image Download

require_once __DIR__.'/../vendor/autoload.php';

$stats = \JLaso\SimpleStats\Stats::getInstance();

$data = isset($_GET['data']) ? trim($_GET['data']) : 'default';
$redirect = isset($_GET['redirect']) ? trim($_GET['redirect']) : 'demo.php';

$stats->insert('clicks', $data);

$userIp = $stats->getUserIP();
$stats->insert('ips', $userIp);

header('Location: '.$redirect);

For more information send a message to info at phpclasses dot org.