just a basic website so that i can see how it all works in php and html
$host = 'irc.rizon.net';
$port = 6667;
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
if (socket_connect($socket, $host, $port))
{
echo "Connected to {$host}:{$port}\n";
while ($data = trim(socket_read($socket, 128)))
{
echo "Data read: {$data}\n";
}
}
else die ('Failed to connect, check that the host IP is correct and the port is open.');
$server = mysql_connect('localhost', 'root', 'test'); //'localhost' is the server, can be an IP. 'root' is the username, use whatever your is. 'test' is the password, again whatever yours is.
if (mysql_select_db('conqueremu')) //'conqueremu' is the database name
{
$query = mysql_query('SELECT Level FROM characters WHERE Name=\'Ykage\''); // Select the value of 'Level' for the character with the in-game name of 'Ykage'
while ($row = mysql_fetch_array($query)) // Fetch the array of results, in this case only one. So; we could use an if statement, but this is more generic.
{
echo "Level of Ykage is {$row['Level']}\n"; // Output it
}
}
else die (mysql_error()); // We died because it's the wrong database, it doesn't exist?!!