<?php
error_reporting(E_ALL ^ E_DEPRECATED);
mysqli_report(MYSQLI_REPORT_OFF);
include "../include/variables.php";
include "../include/functions.php";
include "../include/errors.php";
include "../include/getip.php";
if (!function_exists("getinfo")) {
function getinfo() {
global $ip, $host;
return "[".date("Y-m-d H:i:s")." $ip".(!empty($host)?" $host":"")."]";
}
}
$PHP_SELF=$_SERVER['PHP_SELF'];
if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
if (ob_get_length()) ob_end_clean();
ob_start("ob_gzhandler");
}
else ob_start();
if (!empty($_SERVER['HTTPS'])) {
$session_options = array(
"secure" => true,
"SameSite" => "None"
);
session_set_cookie_params($session_options);
}
session_start();
header("Content-Type: text/html; charset=UTF-8");
include "../include/iplog.php";
$debug=true;
function uniqWords($arr){
$i=0;
echo "<b>Antispam Analysis</b><br>\n";
foreach ($arr as $txt) {
$txt=strtolower($txt);
$cnt[$i] = array_count_values(str_word_count($txt, 1));
if ($i == 0) $count=$cnt[0];
foreach($cnt[$i] as $key=>$value){
if (isset($count[$key])) {
if ($i != 0) $tmp[$key]=$count[$key];
$tmp[$key][]=$value;
}
}
$i++;
$count = $tmp;
$tmp=Array();
echo "File$i: ";
if (isSpam($txt)) echo "Spam";
else echo "Not Spam";
echo "<br>\n";
}
echo "<hr>\n";
echo "<b>Unique Words</b><br>\n";
if (count($count) > 0) {
ksort($count, SORT_STRING);
foreach ($count as $name=>$value) {
echo $name.": ";
$i = 0;
$total=0;
foreach ($value as $key=>$val) {
echo $val;
$total+=$val;
if (++$i < count($value)) echo " | ";
}
echo " | Avg: ".($total/$i)." (".round($total/$i).")";
echo "<br>\n";
}
} else echo "None. ";
}
include "../include/antispam.php";
if (!empty($_POST['msg1'])) {
$list[] = $_POST['msg1'];
if (!empty($_POST['msg2'])) $list[]=$_POST['msg2'];
if (!empty($_POST['msg3'])) $list[]=$_POST['msg3'];
if (!empty($_POST['msg4'])) $list[]=$_POST['msg4'];
uniqWords($list);
}
echo "<form method=\"post\">
<textarea name=\"msg1\" rows=\"10\" cols=\"50\">".(isset($_POST['msg1'])?htmlspecialchars($_POST['msg1']):"")."</textarea>
<textarea name=\"msg2\" rows=\"10\" cols=\"50\">".(isset($_POST['msg2'])?htmlspecialchars($_POST['msg2']):"")."</textarea>
<br><textarea name=\"msg3\" rows=\"10\" cols=\"50\">".(isset($_POST['msg3'])?htmlspecialchars($_POST['msg3']):"")."</textarea>
<textarea name=\"msg4\" rows=\"10\" cols=\"50\">".(isset($_POST['msg4'])?htmlspecialchars($_POST['msg4']):"")."</textarea>
<br><input type=\"submit\" value=\"Submit\">";
?>
You can also check other includes below (some files are hidden as they are in exclusion list):
functions.php
errors.php
getip.php
iplog.php
antispam.php