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
die inhalt.php
die login.html
Besten Dank für die Hilfe
escape
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
Please also mark the comments that contributed to the solution of the article
Content-Key: 33092
Url: https://administrator.de/contentid/33092
Printed on: April 23, 2024 at 07:04 o'clock
5 Comments
Latest comment
Hi,
probiers mal so:
Gruß
Dani
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
Hi,
also bei mir gehts, wenn ich 2 Dateien draus mache. 1x inhalt.html und inhalt.html.
inhalt.html
inhalt.php
Gruß
Dani
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