示例#1
0
session_start();
include 'ClickClass.php';
include 'ClassSessions.php';
$obj = new ClickClass();
date_default_timezone_set('America/New_York');
if (isset($_SESSION["id"]) && !empty($_SESSION["id"])) {
    $obj->SessionID = nullif($_SESSION["id"]);
    $obj->clickType = nullif($_POST["clickType"]);
    $obj->EntryTime = date("Y-m-d H:i:s", time());
    $obj->ClickComment = nullif($_POST["ClickComment"]);
    $obj->CurrentPage = nullif($_POST["CurrentPage"]);
    $obj->clickContent = nullif($_POST["clickContent"]);
    $obj->Country = nullif($_POST["Country"]);
    $obj->City = nullif($_POST["City"]);
} else {
    $_SESSION["id"] = ClassSessions::sessionSettor();
    $obj->SessionID = nullif($_SESSION["id"]);
    $obj->clickType = nullif($_POST["clickType"]);
    $obj->EntryTime = date("Y-m-d H:i:s", time());
    $obj->ClickComment = nullif($_POST["ClickComment"]);
    $obj->CurrentPage = nullif($_POST["CurrentPage"]);
    $obj->clickContent = nullif($_POST["clickContent"]);
    $obj->Country = nullif($_POST["Country"]);
    $obj->City = nullif($_POST["City"]);
}
//print_r($obj);
function nullif($var)
{
    if (isset($var) && !empty($var)) {
        return $var;
    } else {
示例#2
0
<?php

session_start();
include 'ClassSessions.php';
echo date_default_timezone_get();
$obj = new ClassSessions();
echo ClassSessions::sessionSettor();
print_r($_POST);
echo '$_SERVER["REMOTE_ADDR"];     ' . $_SERVER['REMOTE_ADDR'];
echo '$_SERVER["HTTP_X_FORWARDED_FOR"];     ' . $_SERVER['HTTP_X_FORWARDED_FOR'];
echo '$_SERVER["HTTP_CLIENT_IP"];     ' . $_SERVER['HTTP_CLIENT_IP'];