function logUser() { $userID = $_GET['userID']; $productID = $_GET['productID']; $ip = getRealUserIP(); $go = $go . "&userID=" . $userID . "&productID=" . $productID; echo '<br />' . $go; $gosql = "insert into clicks (ipaddr, link) VALUES ('{$ip}', '{$go}')"; $result = $db->query($gosql); // Need to add cookies here $ip = getRealUserIp(); if (isset($_SERVER['HTTP_REFERER'])) { $ref = $_SERVER['HTTP_REFERER']; $insertsql = "INSERT INTO useractions (ip, refer) VALUES ('{$ip}', '{$ref}')"; $result = $db->query($insertsql); } if (!isset($_SERVER['HTTP_REFERER'])) { $ref = "No Referer"; $insertsql = "INSERT INTO useractions (ip, refer) VALUES ('{$ip}', '{$ref}')"; $result = $db->query($insertsql); } }
function db_append_to_log($tabName, $idrec, $opname, $desc, $newval) { global $userid, $link; $idtab = idTabForName($tabName); $op = operationIDForName($opname); $ip = getRealUserIp(); $rectm = date("Y-m-d H:i:s"); $stm = $link->stmt_init(); $stm->prepare('INSERT INTO LOG (RECORDED, IP, ID_USER, ID_TAB, ID_RECORD, OPERATION, DESCRIPTION, NEWVAL) VALUES (?, ?, ?, ?, ?, ?, ?, ?)'); $stm->bind_param('ssiissss', $rectm, $ip, $userid, $idtab, $idrec, $op, $desc, $newval); $stm->execute(); $stm->close(); }
// See above line - we were closing a div that was screwing up the display. Now I like it much better. while ($row = $getcatact->fetch_assoc()) { $slug = $row['slug']; $catname = $row['name']; $uref = $row['uref']; if ($j++ % 3 == 0) { echo '</div><div class="btn-group btn-group-justified">'; } echo '<a href="' . $baseurl . '/products/' . $slug . '" class="btn btn-primary">' . $catname . '</a>'; } echo "</div>"; // end beforeFeatured(); if (isset($_GET['cat'])) { $cat = $_GET['cat']; $goip = getRealUserIp(); $gosql = "insert into clicks (ipaddr, link) VALUES ('{$goip}', '{$cat}')"; $result = $db->query($gosql); } // end addition if (!isset($_GET['cat'])) { echo "<table>"; echo "<tr><td colspan=4><center><h3>Featured Products</h3></td>"; $getfeat = "SELECT id, price, afflink, title, descrip, smallimagedisk, featuredhomepage, slug FROM products WHERE featuredhomepage=11"; $getfeatact = $db->query($getfeat); while ($row = $getfeatact->fetch_assoc()) { $id = $row['id']; $slug = $row['slug']; $afflink = $baseurl . '/products/' . $slug; $title = $row['title']; $descrip = $row['descrip'];