<?php
include_once 'classes/ApacheAccessLogFilter.php';
include_once 'classes/ip2Nation.php';
$source = $_POST['pastedLog'] ? $_POST['pastedLog'] : $_FILES["file"];
$mysqli = new mysqli("localhost", "ip2nUser", "password", "ip2nDatabase");
$ip2nation = new Ip2Nation($mysqli);
$accessLogStr = new ApacheAccessLogFilter($source, explode(",", $_POST['needles']), $ip2nation);
$accessLogStr->filterAll();
?>
<html>
<head>
<link href="css/ALogFilter.css" rel="stylesheet" type="text/css" />
</head>
<body>
<br />Needles used were:<br /><?= $accessLogStr->showNeedles(); ?>
<p>
These are the results for parsing:
<br />
<?= $accessLogStr; ?>
</p>
<hr>
Or plain (please note that there can be restrictions to the size of text pasted here):
<form action="" method="POST" enctype="multipart/form-data">
<p>
Filters:
<br />
<?= $debugger->apacheLogClass->allButtons("<br />"); ?>
<br />
<input type="text" name="needles" id="usingNeedles" />
</p><p>
Submit access log as file:
</p><p>
<input type="file" name="file" id="file">
<br />
</p><p>
Or paste access log here:
<br />
<textarea name='pastedLog' style="width:1200px;height:400px"></textarea>
<br />
<input type='submit' value="submitForm">
</p>
</form>
<script src="js/ALogFilter.js"></script>
<script>
<?= $debugger->apacheLogClass->defNeedlesAsJs(); ?>
needles = new Needles();
</script>
</body>
</html>
|