escape
Goto Top

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

Content-Key: 33092

Url: https://administrator.de/contentid/33092

Printed on: April 23, 2024 at 06:04 o'clock

Member: Dani
Dani May 23, 2006 at 12:47:13 (UTC)
Goto Top
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
Member: escape
escape May 23, 2006 at 13:14:24 (UTC)
Goto Top
Danke für die schnelle Antwort

immer noch das gleiche Problem...
Member: Dani
Dani May 23, 2006 at 13:22:07 (UTC)
Goto Top
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
Member: escape
escape May 23, 2006 at 13:31:29 (UTC)
Goto Top
Jo Danke sehr...

Hatte es komplett falsch eingefügt.

Super, hier wird einem wirklich schnell und kompetent geholfen!

Gruss
escape
Member: dsmcg
dsmcg Jun 08, 2006 at 22:58:11 (UTC)
Goto Top
Manchman sollte man auch sagen woran der Fehler lag.

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