query($query); list($l) = $res->fetch_row(); if (substr($remote_addr, 0, 12) <> '204.130.161.') { $query = 'insert into rest_clikthru (`id`, `clikdate`, `restaurant`, `rem_addr`) values (null, \'' . date('Y-m-d H:i:s') . "', '$r', '$remote_addr')"; if (!($res = $mysqli->query($query))) printf("Error in MySQL: %d (%s)\n", $mysqli->errno, $mysqli->error); } $mysqli->close(); $loc = ($l) ? 'http://' . $l : 'localmenuspdfs/' . $r . '.html'; header("Location: $loc"); ?>