#	echo "skipping {$t->getText()} because LinkTool recently edited this article\n";
 #	continue;
 #}
 $titleObj = Title::newFromText($t);
 if (!$titleObj) {
     continue;
 }
 $r = Revision::newFromTitle($titleObj);
 if (!$r) {
     continue;
 }
 $text = $r->getText();
 debug("checking {$titleObj->getText()}");
 #echo "<tr><td colspan='2'><b>{$t->getText()}</td></tr>\n";
 echo "<b>{$titleObj->getText()}</b><ul>\n";
 $now = replaceText($search, $replace, $baretext, $text);
 echo "</ul>\n";
 #echo("{$t->getText()} - $now links added\n");
 if ($now > 0) {
     $wgTitle = $titleObj;
     $updated++;
     //echo "could update {$t->getText()} with $replacements new links\n";
     $a = new Article($titleObj);
     #if (!$a->updateArticle($text, "LinkTool is sprinkling some RED links", true, false)) {
     #	echo "couldn't update article {$t->getText()}, exiting...\n";
     #	exit;
     #}
 }
 $total += $now;
 $wgTitle = null;
 $tcount++;
    }
}
// SUBMIT BUTTON PRESSED
if (!empty($_POST)) {
    // database connection
    include_once "config.php";
    require_once 'php/databaseConnection.php';
    //check to see if ip hasn't submitted too many times today
    $ip = dailyLimit($con);
    //remove excess space from before first word and after last word before we start anything
    $t = trim($_POST['thing']);
    //take out html or php tags
    $t = strip_tags($t, '');
    // go through different filters based on submission type
    if (isset($_POST['choose']) and $_POST['choose'] !== "") {
        $choose = $_POST['choose'];
        // things to do and suggestions for the site need filters
        if ($choose === "things" or $choose === "suggestions") {
            //check for filtered words
            $reason = filteredWords($t);
            $t = replaceText($t);
        } else {
            if ($choose !== "spam") {
                exit;
            }
        }
        insertIntoDatabase($t, $choose, $ip, $con);
    }
    // end type filters
}
//end submission post