escape

Loginscript hat einen Fehler

Salü @all
Ich schon wieder mit einem Problem, aber wie schon mal gesagt, hier erhält man immer schnell kompetente Antwort.
Ich habe diese Loginscript, dass aber nicht so ganz funktioniert, es kommt immer die Medlung: Falsche Zugangsdaten.

die pwd.php

$benutzer = "test";  
$passwort = "test";  

die inhalt.php

<html> 
<head> 
<title>PW login</title> 
</head> 
<body> 
include("pwd.php");   
if (($benutzer == "$user") and ($passwort == "$pass"))   
{ 
echo "   
<html> 
<head> 
<title>Der Login</title> 
</head> 
<body> 
Das is der Inhalt. 
</body> 
</html> 
";   
} 
else 
{ 
echo "Falsche Zugangsdaten.";   
} 
</body> 
</html>

die login.html

<html> 
<head> 
<title>login</title> 
</head> 
<body> 
<form action="inhalt.php" method="post">   
<table border=0> 
<tr> 
<td>Benutzer:</td> 
<td><input type="text" name="user"></td>   
</tr> 
<tr> 
<td>Passwort:</td> 
<td><input type="pwd" name="pass"></td>   
</tr> 
<tr> 
<td>&</td> 
<td><input type="submit" name="senden" value=Login></td>   
</tr> 
</table> 
</form> 
</body> 
</html>


Besten Dank für die Hilfe
escape
Auf Facebook teilen
Auf X (Twitter) teilen
Auf Reddit teilen
Auf Linkedin teilen

Content-ID: 33092

Url: https://administrator.de/forum/loginscript-hat-einen-fehler-33092.html

Ausgedruckt am: 13.07.2025 um 08:07 Uhr

Dani
Dani 23.05.2006 um 14:47:13 Uhr
Hi,
probiers mal so:
<?php
$benutzer = $_POST['user];  
$passwort = $_POST['pass'];  
?>

<html> 
<head> 
<title>PW login</title> 
</head> 
<body> 
<?
if (($benutzer == "test") and ($passwort == "test"))   
{ 
echo "   
<html> 
<head> 
<title>Der Login</title> 
</head> 
<body> 
Das is der Inhalt. 
</body> 
</html> 
";   
} 
else 
{ 
echo "Falsche Zugangsdaten.";   
} 
?>
</body> 
</html>


Gruß
Dani
escape
escape 23.05.2006 um 15:14:24 Uhr
Danke für die schnelle Antwort

immer noch das gleiche Problem...
Dani
Dani 23.05.2006 um 15:22:07 Uhr
Hi,
also bei mir gehts, wenn ich 2 Dateien draus mache. 1x inhalt.html und inhalt.html.

inhalt.html
<html> 
<head> 
<title>login</title> 
</head> 
<body> 
<form action="inhalt.php" method="post">   
<table border=0> 
<tr> 
<td>Benutzer:</td> 
<td><input type="text" name="user"></td>   
</tr> 
<tr> 
<td>Passwort:</td> 
<td><input type="pwd" name="pass"></td>   
</tr> 
<tr> 
<td>&</td> 
<td><input type="submit" name="senden" value=Login></td>   
</tr> 
</table> 
</form> 
</body> 
</html>


inhalt.php
<?php
$benutzer = $_POST['user'];  
$passwort = $_POST['pass'];  
?>

<html> 
<head> 
<title>PW login</title> 
</head> 
<body> 
<?
if (($benutzer == "test") and ($passwort == "test"))   
{ 
echo "   
<html> 
<head> 
<title>Der Login</title> 
</head> 
<body> 
Das is der Inhalt. 
</body> 
</html> 
";   
} 
else 
{ 
echo "Falsche Zugangsdaten.";   
} 
?>
</body> 
</html>


Gruß
Dani
escape
escape 23.05.2006 um 15:31:29 Uhr
Jo Danke sehr...

Hatte es komplett falsch eingefügt.

Super, hier wird einem wirklich schnell und kompetent geholfen!

Gruss
escape
dsmcg
dsmcg 09.06.2006 um 00:58:11 Uhr
Manchman sollte man auch sagen woran der Fehler lag.

Schuld war REGISTER_GLOBALS die ausgeschaltet sind. (was auch gut so ist)