M
matibaski
Guest
Moin!
Habe mal ein Problem..
Und zwar, dass ich mit FireFox in mein CMS komme, doch im IE nicht.
Nämlich:
Im IE kommt die Passwortaufforderung.
Ich gebe das Passwort ein, das stimmt. Doch es kommt immer die Errormeldung, die Sagt, dass mein Passwort falsch ist.
Benötigte Dateien für das Login:
->index.php (Loginseite)
->login.php Prüft passwort und leitet auf admin.php weiter
->admin.php prüft ob Session gültig ist. Wenn ja, dann Inhalt zeigen.
Habe jeweils die Codes aufgelistet:
index.php:
Also es prüft hier, ob install.php gelöscht ist. Wenn ja dann Loginfeld zeigen. Wenn nein, dann Meldung geben,. Wenn install.php existiert, aber config.php nicht, dann kommt die Installation.
Hier stimmt es bis jetzt.
Nun die login.php:
Also hier prüft es das Passwort. Wenn es stimmt, dann ist das Passwort zugleich die Session. Das Passwort steht in config.php..
Keine Angst, niemand sieht es auf dem Web.
Denn es ist so gemacht:
Nun die admin.php
Also wenn die Session Passwort gleich wie $Zugangspasswort ist, dann kommt der Inhalt. Wenn nicht, dann kommt die Meldung, die ich im IE immer sehe. Das Passwort ist falsch.
Zum Testen:
http://freerunning.pytalhost.net/admin/index.php
Passwort ist "michel"
Im Firefox ist alles okay, aber im IE kommt die Meldung, session ist ungültig.
Weiss jemand wieso?
Das Problem ist sehrwarscheinlich bei login.php
Aber ich komme nicht drauf.
MfG, matibaski
Habe mal ein Problem..
Und zwar, dass ich mit FireFox in mein CMS komme, doch im IE nicht.
Nämlich:
Im IE kommt die Passwortaufforderung.
Ich gebe das Passwort ein, das stimmt. Doch es kommt immer die Errormeldung, die Sagt, dass mein Passwort falsch ist.
Benötigte Dateien für das Login:
->index.php (Loginseite)
->login.php Prüft passwort und leitet auf admin.php weiter
->admin.php prüft ob Session gültig ist. Wenn ja, dann Inhalt zeigen.
Habe jeweils die Codes aufgelistet:
index.php:
PHP:
<?php
if(file_exists('install.php')) // Wenn install.php existiert,
{
if(!file_exists('config.php')) // dann prüfen, ob config.php nicht existiert. Wenn nicht, dann
{
echo'<p align=center valign=middle><a href=install.php>Installation</a></p>'; // Installationspfad angeben.
}
else // Wenn config.php doch existiert,
{
echo'Bitte löschen Sie install.php und das Verzeichnis install/';
}
}
else
{
echo'<html>';
echo'<head>';
echo'<title>Login</title>';
echo'<link rel="stylesheet" type="text/css" href="format.css">';
echo'</head>';
echo'<body>';
echo'<p align="center"><b><font size="6">Administration</font></b><br>';
echo'<form action="login.php" method="post">';
echo'<div align="center">';
echo'<table cellpadding="0" cellspacing="0" width="296" height="77">';
echo'<!-- MSTableType="nolayout" -->';
echo'<tr>';
echo'<td height="38">Passwort:';
echo'<input name="Passwort" size="10" type="password"></td>';
echo'</tr>';
echo'<tr>';
echo'<td height="39">';
echo'<input name="Send" type="submit" value="Login"></td>';
echo'</tr>';
echo'</table>';
echo'</div>';
echo'</form></p>';
echo'<table cellpadding="0" cellspacing="0" width="100%" height="19">';
echo'<tr>';
echo'<td height="19" align="center" valign="middle">Admintool © by Matija Baskarad</td>';
echo'</tr>';
echo'</table>';
echo'</body>';
echo'</html>';
}
?>
Hier stimmt es bis jetzt.
Nun die login.php:
PHP:
<?php
include("config.php");
$Zugangspasswort = "$passwort";
if($_REQUEST['Send'] && $_REQUEST['Passwort'] == $Zugangspasswort)
{
session_start();
session_register("Passwort");
$_SESSION['Passwort'] = $Zugangspasswort;
}
?>
<html>
<head>
<title>Administration</title>
<link rel="stylesheet" type="text/css" href="format.css">
</head>
<body>
<?php
if($_SESSION['Passwort'] == $Zugangspasswort)
{
echo"Sie sind erfolgreich eingeloggt!<br>Sie werden zur Administration weitergeleitet.<script>top.location.href='admin.php?site=main'</script>";
}
else
{
echo 'Sie sind nicht befugt, diese Seite anzusehen<br />Möglicherweise ist das eingegeben Passwort falsch.<br /><br />';
echo 'Bitte loggen Sie sich <a href="index.php">hier</a> erneut ein.';
}
?>
</body>
</html>
Keine Angst, niemand sieht es auf dem Web.
Denn es ist so gemacht:
PHP:
<?php
$passwort = "passwort";
?>
PHP:
<?php
session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Administration</title>
<style type="text/css">
body {
font-family: Verdana,Arial;
font-size: 10pt;
color: #000000;
background-color: #ffffff;
}
table, tr, td {
font-family: Verdana,Arial;
font-size: 10pt;
color: #000000;
}
</style>
</head>
<body style="background-image:url(images/bg.png); background-repeat:repeat-x;">
<?php
include("config.php");
$Zugangspasswort = $passwort;
if($_SESSION['Passwort'] == $Zugangspasswort)
{
echo'<div align="center">';
echo'<table cellpadding="0" cellspacing="0" width="720" height="338">';
echo'<!-- MSTableType="nolayout" -->';
echo'<tr>';
echo'<td height="171" width="720" colspan="3">';
echo'<img border="0" src="images/top.gif" width="720" height="171"></td>';
echo'</tr>';
echo'<tr>';
echo'<td height="147" width="156" valign="top" bordercolorlight="#000000" bordercolor="#000000">';
echo'<table cellpadding="0" cellspacing="0" width="100%" height="84">';
echo'<!-- MSTableType="nolayout" -->';
echo'<tr>';
echo'<td height="5">';
echo'<img border="0" src="images/navig_top.png" width="156" height="5"></td>';
echo'</tr>';
echo'<tr>';
echo'<td height="74">';
echo'<table cellpadding="0" cellspacing="0" width="156" background="images/navig_middle.png" height="150%">';
echo'<!-- MSTableType="nolayout" -->';
echo'<tr>';
echo'<td height="111" width="6"> </td>';
echo'<td height="111" width="150" valign="top">';
if(!isset($_GET['navig']))
{
$_GET['navig'] = 'main';
}
switch($_GET['navig'])
{
default: include("_private/navig_main.php"); break;
case 'main' : include("_private/navig_main.php"); break;
}
echo'</td>';
echo'<td height="111" width="6"> </td>';
echo'</tr>';
echo'</table>';
echo'</td>';
echo'</tr>';
echo'<tr>';
echo'<td height="5">';
echo'<img border="0" src="images/navig_bottom.png" width="156" height="5"></td>';
echo'</tr>';
echo'</table>';
echo'</td>';
echo'<td height="148" width="18"> </td>';
echo'<td height="147" width="546" valign="top">';
echo'<table cellpadding="0" cellspacing="0" width="546" height="100%">';
echo'<!-- MSTableType="nolayout" -->';
echo'<tr>';
echo'<td height="17" width="547" valign="top">';
echo'<table cellpadding="0" cellspacing="0" width="100%" height="128">';
echo'<!-- MSTableType="nolayout" -->';
echo'<tr>';
echo'<td height="4" valign="top">';
echo'<img border="0" src="images/content_top.gif" width="546" height="4"></td>';
echo'</tr>';
echo'<tr>';
echo'<td height="120" valign="top">';
echo'<table cellpadding="0" cellspacing="0" width="546" background="images/content_middle.gif" height="100%">';
echo'<!-- MSTableType="nolayout" -->';
echo'<tr>';
echo'<td height="89" width="6"> </td>';
echo'<td height="89" width="494" valign="top">';
$site = $_GET['site'];
if(!isset($site))
{
$_GET['site'] = 'main';
}
switch($site)
{
default: include("_private/main.php"); break;
case 'main' : include("_private/main.php"); break;
case 'content_bearbeiten' : include("content/content_bearbeiten.php"); break;
case 'content_insert' : include("content/content_insert.php"); break;
case 'logout' : include("_private/logout.php"); break;
case 'einstellungen' : include("einstellungen/einstellungen.php"); break;
case 'save' : include("einstellungen/save.php"); break;
case 'write' : include("einstellungen/write.php"); break;
case 'auswaehlen' : include("einstellungen/auswaehlen.php"); break;
}
echo'</td>';
echo'<td height="89" width="47"> </td>';
echo'</tr>';
echo'</table>';
echo'</td>';
echo'</tr>';
echo'<tr>';
echo'<td height="4" valign="top">';
echo'<img border="0" src="images/content_bottom.gif" width="546" height="4"></td>';
echo'</tr>';
echo'</table>';
echo'</td>';
echo'</tr>';
echo'</table>';
echo'</td>';
echo'</tr>';
echo'<tr>';
echo'<td height="19" width="720" valign="middle" bordercolorlight="#000000" bordercolor="#000000" colspan="3">';
echo'<p align="center">Admintool © by Matija Baskarad</td>';
echo'</tr>';
echo'</table>';
echo'</div>';
}
else
{
echo 'Ihre Session ist nicht gültig!<br />';
echo 'Bitte loggen Sie sich <a href="index.php">hier</a> ein.';
}
?>
</body>
</html>
Zum Testen:
http://freerunning.pytalhost.net/admin/index.php
Passwort ist "michel"
Im Firefox ist alles okay, aber im IE kommt die Meldung, session ist ungültig.
Weiss jemand wieso?
Das Problem ist sehrwarscheinlich bei login.php
Aber ich komme nicht drauf.
MfG, matibaski