Man sucht eine bestimmte Datei eines Users, weiß aber nur Nicknamen, IP-Adresse, E-Mail Adresse oder Hostnamen.
Da ist guter Rat teuer, dieses kleine Addon schafft abhilfe.
Zum Eintrag in der Datenbank
Da ist guter Rat teuer, dieses kleine Addon schafft abhilfe.
PHP-Quellcode
- <?php
- // GTChat Suchscript
- // Version 0.7b
- // Release 11.04.2008
- // Entwickelt durch Sven Schmidt | GTChat-Developer.de
- // Support auf www.gtchat-developer.de | info@gtchat-developer.de
- // Alle Rechte unterliegen www.gtchat-developer.de
- // *** Durchsucht das "Member-Verzeichnis" nach bestimmten Suchwerten.
- ob_start();
- // Konfiguration
- $root = ''. $_SERVER['DOCUMENT_ROOT'] .'/cgi-bin/Members'; // Verzeichnis der Userdateien.
- ?>
- <html>
- <head>
- <title>Chat - Analysescript</title>
- <link rel="stylesheet" href="style.css">
- </head>
- <body style="margin:0px;">
- <?php
- // Start: GTChat Suchscript
- ?>
- <p><h4>GTChat Suchscript 0.7b - Support auf www.gtchat-developer.de</h4></p>
- <form action="<?=$_SERVER['PHP_SELF'];?>" method="POST">
- <table cellspacing="0" cellpadding="2" style="border:0px; width:100%;">
- <tr>
- <td valign="top"><span style="font-weight:bold;">Bitte Suchkriterium auswählen:</span></td>
- <td valgin="top">
- <select name="value">
- <option value="0" <? if($_POST['value'] == 0){ echo 'selected'; ?>>Bitte wählen</option>
- <option value="1" <? if($_POST['value'] == 1){ echo 'selected'; ?>>Nickname</option>
- <option value="2" <? if($_POST['value'] == 2){ echo 'selected'; ?>>E-Mail Adresse</option>
- <option value="3" <? if($_POST['value'] == 3){ echo 'selected'; ?>>IP-Adresse</option>
- <option value="4" <? if($_POST['value'] == 4){ echo 'selected'; ?>>Hostname</option>
- </select>
- </td>
- </tr>
- <tr>
- <td valign="top"><span style="font-weight:bold;">Bitte Suchbegriff eingeben:</span></td>
- <td valgin="top"><input type="text" name="value2" value="<?=$_POST['value2'];?>"></td>
- </tr>
- <tr>
- <td valign="top"><input type="reset" name="reset" value="Eingaben zurücksetzen"></td>
- <td valign="top"><input type="submit" name="submit" value="Suchen"></td>
- </tr>
- </table>
- </form>
- <?
- if(isset($_POST['submit'])){
- if($value > 0){
- $value = $_POST['value'];
- $value2 = $_POST['value2'];
- }
- if(isset($value) && isset ($value2)){
- $basedir=opendir($root);
- while ($file =readdir($basedir)) {
- $data=file(''. $root .'/ '. $file .'');
- if(eregi($value2, $data[$value])){
- ?>
- <p><h4>Suche erfolgreich abgeschlossen.</h4></p>
- <p>Das Ergebnis lautet:</p>
- <p>Der Benutzer <?=$data[1];?> wurde gefunden.</p>
- <p>Das Suchkriterium lautete:</p>
- <p>Finde
- <?php
- if($value == 1){ echo' den Nickname'; }
- if($value == 2){ echo' die E-Mail Adresse'; }
- if($value == 3){ echo' die IP-Adresse'; }
- if($value == 4){ echo' den Hostnamen'; }
- ?>
- von <?=$value2;?>.
- </p>
- <p>Folgende Daten wurden übermittelt:</p>
- <ul>
- <li>Nickname: <?=$data[1];?></li>
- <li>E-Mail Adresse: <?=$data[3];?></li>
- <li>IP Adresse: <?=$data[6];?></li>
- <li>Hostname: <?=$data[8];?></li>
- </ul>
- <p>Die Datei lautet: <span style="font-weight:bold;"><?=$file;?></span></p>
- <?
- }
- }
- }
- }
- ?>
- </body>
- </html>
- <? ob_end_flush();?>
Zum Eintrag in der Datenbank