<?php
session_start();
session_register(username);
include (config.php);
$password=crypt($_REQUEST['password'],$schluessel);
$password .= \n;
$log=0;
$userdatei = fopen (benutzer.txt,r);
while ($zeile = fgets($userdatei,50)) {
$userdata = explode(|, $zeile);
if ($userdata[0]==$_REQUEST['username'] && $userdata[1]==$password) {
$log=1;
$loginStatus = allGood;
}
}
fclose($userdatei);
?>
<?php
if ($log==1) {
function crc($crc,$c){
$feedback=0x8408;
$count = 8;
$c= $c;
$crc= $crc;
while($count) {
if(($c ^ $crc) & 0x0001)
$crc= ($crc>>1) ^ $feedback;
else
$crc >>= 1;
$c >>= 1;
$count --;
}
return($crc);
}
/* startwert */
$crc=5;
$new=$_POST[w];
if($_POST[submit] && is_array($new)) {
$out=100,100,100,100,0\r\n;
while(list(,$nr)=each($new)) {
(!empty($nr[0])) && ($out.=$nr[0],$nr[1]\r\n$nr[2],0\r\n);
}
for ($i = 0; $i < strlen($out); $i++) {
$crc=crc($crc,ord($out[$i]));
}
$out=// DO NOT EDIT THIS FILE. It won´t work afterwords !\r\n//\r\n.$out.sprintf(%04X, $crc);
header('Content-Disposition: inline; filename=file.psy');
header('Content-length:->.strlen($out));
header('Content-type: application/octetstream');
echo $out;
//MAILVERSAND
// empfaenger
$empfaenger = [email protected];
// subject
$subject = datei;
// message
$message = Nachricht von ...\n\n
$email war hier und hat das bekommen:\n
$out\n\n\n
und bla bla\n;
while(list($name,$value)=each($HTTP_POST_VARS)) {
$message.=$name: $value\n\n;
}
mail($empfaenger,$subject,$message,From: $email);
//ENDE MAILVERSAND
exit;
}
?>
<!doctype html public -//W3C//DTD HTML 4.01 Transitional//EN>
<head>
<title>Welcome - you are logged in!</title>
<meta http-equiv=Content-Type content=text/html; charset=iso-8859-1>
</head>
<body>
<div id=inhalt>
<p align=right> <a href=[url]http://www.bla.com[/url] target=top>bla</a></p>
<h1>.. </h1>
<br>
<p>
<b>
<?php
if(isset($loginStatus) && $loginStatus == allGood){
echo Welcome .$_REQUEST['username'];
//bericht fuer db
$fp=fopen(entries.db,a);
flock($fp,2); // locking file
fputs($fp, ( addslashes($_REQUEST['username'])).||.
addslashes(date(d. M Y , H:i:s)).\n\n\n);
flock($fp,3); // unlocking file
fclose($fp);
}else{
include ($form_redirect_page);
die;
}
?>
<form name=FormName action=<?php echo $PHP_SELF; ?> method=post>
<input type=hidden name=email value=<?php echo $_REQUEST['username']; ?>>
<table width=300 border=0 cellpadding=0 cellspacing=4>
<tr>
<td align=center class=txt>1</td>
<td align=center class=txt>2</td>
<td align=center class=txt>3</td>
</tr>
<?php
for ($i = 1; $i <= 16; $i++) {
?>
<tr>
<td align=center><input maxlength=1 type=text name=w[<?php echo $i?>][1] size=4 class=formular></td>
<td align=center><input maxlength=3 type=text name=w[<?php echo $i?>][0] size=4 class=formular></td>
<td align=center><input maxlength=3 type=text name=w[<?php echo $i?>][2] size=4 class=formular></td>
</tr>
<?php
}
?>
</div>
<br>
<br>
<p>&nbsp;<b>&nbsp;</b>
<input type=submit value=&nbsp;&nbsp;submit&nbsp;&nbsp; class=formular name=submit>
&nbsp;&nbsp;
<input type=reset value=reset name=zurückstellen class=formular>
&nbsp;&nbsp;&nbsp;&nbsp;<?php echo <a href=\$logoutseite\><b><u>Logout</u></b></a>; ?></p>
</form>
<?php
}
else
{
echo Benutzer existiert nicht oder das Passwort ist falsch!<br><a href=\$loginseite\>zurück</a>;
}
?>