<form action="index.php" method="get"> Username: <input type="text" name="name" /><br /> <input type="submit" /> </form>'); } $http = new http(); $wpq = new wikipediaquery(); $wpapi = new wikipediaapi(); $name = mysql_escape_string(ucfirst(ltrim(rtrim($_GET['name'])))); $oldname = $_GET['name']; $names_old = array(); //Check if the user is an IP address if (preg_match('/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/', $name)) { toDie('Cannot be an IP.'); } $wlh = $wpapi->backlinks('User:'******'redirects', false); foreach ($wlh as $bl) { $names_old[] = $bl['title']; } //Connect to database require_once '/data/project/xtools/database.inc'; $mysql = mysql_connect('enwiki.labsdb', $toolserver_username, $toolserver_password); @mysql_select_db('enwiki_p', $mysql) or toDie("MySQL error, please report to X! using <a href=\"//en.wikipedia.org/wiki/User:X!/Bugs\">the bug reporter.</a> Be sure to report the following SQL error when reporting:<br /><pre>" . mysql_error() . "</pre>"); $tools = mysql_connect("tools-db", $toolserver_username, $toolserver_password); @mysql_select_db("p50380g50570_xtools", $tools) or toDie("MySQL error, please report to X! using <a href=\"//en.wikipedia.org/wiki/User:TParis/Bugs\">the bug reporter.</a> Be sure to report the following SQL error when reporting:<br /><pre>" . mysql_error() . "</pre>"); unset($toolserver_username, $toolserver_password); //Done function getSuccessfulRfAs() { global $wpapi; $titles = array();