Hallo ich habe ein Loginskript, dass die Information des Users ($one) anhängen soll, jedoch wird ein Link erstellt bei der die Variable leer zu sein scheint. Ich habe mir das Skript mehrmals angeschaut aber kein Fehler gefunden. Aber mehrere Augen sehen ja bekanntlich mehr als zwei: Vielleicht findet hier ja jemand einen Fehler (Das einloggen funktioniert ja):
<?php
session_start();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Interner Bereich</title>
</head>
<body text="#FFFFFF" link="#FF0000" vlink="#FF0000" alink="#FF0000" bgcolor="#FFC20F" topmargin="0" marginheight="0" leftmargin="0" marginwidth="0" oncontextmenu="return false" onselectstart="return false">
<br>
<table width="150%" border="0" cellpadding="0" cellspacing="0">
<tr valign="top" >
<td valign="top" ><table width="100%" cellpadding="3" bgcolor="#E2031A" cellspacing="1" border="0">
<tr>
<td align="justify" width="100%">
<font color="#FFFFFF"><b>Login</b></font>
</tr>
</table>
<table width="100%" cellpadding="3" cellspacing="1" border="0"><tr>
<td height="15" width="100%"></td>
<tr>
<td width="100%"><br>
<?php
$username = $_POST["username"];
$passwort = $_POST["password"];
$passwort = md5($passwort);
$log=0;
$str = md5($_POST["username"]);
$Base64_Encode = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
"S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o",
"p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/");
$Base64_Value = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16",
"17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35",
"36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55",
"56", "57", "58", "59", "60", "61", "62", "63");
$Encode = array_combine($Base64_Encode, $Base64_Value);
for($i = 0; $i < strlen($str1); $i++)
{
$new_str .= str_pad(decbin($Encode[$str{$i}]), 8, 0, STR_PAD_LEFT);
}
$str1 = $new_str;
$Base64_Encode = array("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
"S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o",
"p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "/");
$Base64_Value = array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16",
"17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35",
"36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55",
"56", "57", "58", "59", "60", "61", "62", "63");
$Encode = array_combine($Base64_Encode, $Base64_Value);
for($i = 0; $i < strlen($str1); $i++)
{
$one = str_pad(decbin($Encode[$str1{$i}]), 8, 0, STR_PAD_LEFT);
}
$userdatei = fopen ("ap/user.txt","r");
while (!feof($userdatei))
{
$zeile = fgets($userdatei,500);
$userdata = explode("|", $zeile);
if ($userdata[0]==$username and $passwort==trim($userdata[1]))
{
$_SESSION['username'] = $username;
{
echo "<b>Login war erfolgreich.</b><br><a href='geheim.php?100010010100101010010100101=.$one./'>";
echo "Zum geschützten Bereich hier klicken!</a><br>
<br>
<br>
<a href=\"/beta/ap\">Zum Administrationspanel hier klicken!</a> <br>
extra Kennwort benötigit</p><br><br>Dieser Link ist aus Sicherheitsgründen leider notwendig. Ich bitte zu entschuldigen das keine automatische Weiterleitng erfolgen kann.";
$log = 1;
}
}
}
fclose($userdatei);
if ($log==0)
{
echo "Zugriff verweigert <a href=\"login.htm\">Zurück</a>";
}
?>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>