#!/usr/bin/perl
use CGI; $cgi = new CGI; print $cgi->header;
$username = $cgi->param('user');
$passwort = $cgi->param('pass');
Das ist so nicht wirklich sicher, weil unverschlüsselte Datei
open (PASS, "$username.pass") || die print qq~<p>Dieser Nick ist nicht vorhanden.</p>\n~;
my $correctpass = <PASS>;
close(PASS);
if ($passwort eq $correctpass) {
&goodpass;
}
else {
&badpass;
}
sub goodpass
{
open(USERDATA, "whoisonline.dat") || die print "<p>Die Liste der Online-User ist nicht vorhanden.</p>\n";);
my @users=<USERDATA>;
close(USERDATA);
my $USERS_ONLINE = "";
foreach $user_online(@users)
{
USERS_ONLINE .= qq~<a href="viewprofile.cgi?user=$user_online" target="_blank">$user_online</a><br>\n~;
}
print qq~<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<meta http-equiv="refresh" content="10;URL=whoisonline.cgi?user=$username&pass=$passwort">
<link href="styles.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
<!--
var tipWin = null;
function opentip()
{
str = "profile.cgi?MyName=$username&pass=$passwort";
tipWin = window.open(str,"tipWin", "width=300, height=350, resizeable=no, scrollbars=no");
window.open (str, "tipWin", "width=300, height=350");
tipWin.opener = self;
}
//-->
</script>
</head>
<body>
<h2>Einstellungen:</h2>
<a href="javascript:opentip()">Profil editieren</a><br>
<br>
Wer ist Online?<br>
<br>
<!-- Ausgabe Usernamen -->
$USERS_ONLINE
<!-- /Ausgabe Usernamen -->
</body>
</html>
in styles.css zum Beispiel:
body {
background-color: #006666;
color: #ff8c00;
}
body, h2, a {
font-family: tahoma, arial, helvetica, sans-serif;
font-size: 10px;
font-weight: bold;
}
h2 {
font-size: 14px;
color: #ffcc66;
}
a {
font-weight: normal;
text-decoration: none;
}
P.S.: DIESER CODE WURDE AUF DIE SCHNELLE ZUSAMMENGEHACKT UND NICHT GETESTET! DAHER KEINE HAFTUNG FÜR LOGISCHE, SYNTAKTISCHE ODER TIPPFEHLER !!!
;)