hey
ich hab ein probelm bei LoginSystem hab gemacht aber ich kann mich nit anmelden da komm immmer ein fehler könnt ihr mir dabei helfen
hier ist der link http://mafioso147.ma.funpic.de/
Druckbare Version
hey
ich hab ein probelm bei LoginSystem hab gemacht aber ich kann mich nit anmelden da komm immmer ein fehler könnt ihr mir dabei helfen
hier ist der link http://mafioso147.ma.funpic.de/
sag uns bitte mal was für ein fehler kommt !Zitat:
Zitat von pate
versuch dich mal zu Registrieren das geht nit
Added after 20 minutes:
kann mir jemand helfen wäre cool
Ohne code kann man nichts machen... poste den mal
hier ist der ganze index code
Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!--
+---------------------------------------------------------+
| |
| Copyright by RaveShowNetworkZ 2oo6 |
| |
| Design by : RAVESHOW |
| Code by : RAVESHOW |
| |
| Contact: raveshow@web.de |
| |
| http://raveshow.funpic.de/ |
+---------------------------------------------------------+
-->
<? session_start(); ?>
<title>PHPLogin System mit .txt und Sessions</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="login.css">
</head>
<body>
<center>
<table>
<form action="<? $PHP_SELF; ?>" method="post">
<tr>
<td colspan="2" align="left">LoginSystem<hr></td>
</tr>
<tr>
<td>Benutzername:</td>
<td><input type="text" size="25" name="benutzername"></td>
</tr>
<tr>
<td>Passwort:</td>
<td><input type="password" size="25" name="passwort"></td>
</tr>
<tr>
<td colspan="2" align="left"><hr></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" value="Einloggen" name="login"></td>
</tr>
<tr>
<td colspan="2" align="center">
<?
// Falls ein fehler beim einloggen passiert kommt man hier hin...
if(isset($_GET["error"])) {
echo "Login fehlgeschlagen!";
}
// Wenn man den Einloggen Button gedrückt hat wird dieser PHP teil ausgeführt...
if(isset($_POST["login"])) {
// Ein paar Variabeln...
$var_usr = $_POST["benutzername"];
$var_pwd = $_POST["passwort"];
$var_f = "benutzer/".$var_usr.".lif";
// Wenn die Datei existiert soll er weitermachen...
if(file_exists($var_f)) {
// Jetzt wird die Datei in ein Array eingelesen...
$check = array();
$datei = fopen($var_f, "r");
$lesen = fgets($datei, 1024);
array_push($check, $lesen);
fclose($datei);
$lif = explode("§§", $check[0]);
// Checken ob die im Formular eingegebenen Daten mit denen aus der Datei übereinstimmen...
if($var_usr == $lif[0] && md5($var_pwd) == $lif[1]) {
// Wenn alles richtig war bis jetzt werden die Daten aus der Datein in SessionVariabeln übergeben...
$_SESSION["lif_benutzer"] = $lif[0];
$_SESSION["lif_passwort"] = $lif[1];
$_SESSION["lif_email"] = $lif[2];
// Nun wird man zur geschützten Seite verfrachtet...
header("Location:main.php");
} else {
// Wenn die Daten nicht stimmen wird man zur Startseite zurückverfrachtet...
header("Location:index.php?error=1");
}
} else {
// Wird ausgegeben wenn die .lif Datei des Benutzers nicht existiert...
echo "Den Benutzer: $var_usr gibt es nicht!";
}
}
?>
</td>
</tr>
<tr>
<td colspan="2" align="left">Registrieren?</td>
</tr>
</form>
</table>
</center>
</body>
</html>
der fehler liegt so wie ich es gesehen habe nicht in der index.php sonder in der createnew.php oder wie die da heißt....
häufigster fehler ist, wenn die anderen php´s in unterordner gespeichert sind und dann der pfad nicht geändert worden ist.
poste mal den code von der createnew.php
hier createnew.php code
Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!--
+---------------------------------------------------------+
| |
| Copyright by RaveShowNetworkZ 2oo6 |
| |
| Design by : RAVESHOW |
| Code by : RAVESHOW |
| |
| Contact: raveshow@web.de |
| |
| http://raveshow.funpic.de/ |
+---------------------------------------------------------+
-->
<title>PHPLogin System mit .txt und Sessions</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="login.css">
</head>
<body>
<center>
<table>
<form action="<? $PHP_SELF; ?>" method="post">
<tr>
<td colspan="2" align="left">LoginSystem - Neuregistrierung<hr></td>
</tr>
<tr>
<td>Benutzername:</td>
<td><input type="text" size="25" name="neuer_benutzer"></td>
</tr>
<tr>
<td>Passwort:</td>
<td><input type="password" size="25" name="neues_passwort"></td>
</tr>
<tr>
<td>e-Mail:</td>
<td><input type="text" size="25" name="neue_email"></td>
</tr>
<tr>
<td colspan="2" align="left"><hr></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" value="Registrieren" name="reg"></td>
</tr>
<tr>
<td align="center" colspan="2">
<?
// Ein paar Variabeln bestimmen...
$var_user = $_POST["neuer_benutzer"];
$var_pass = $_POST["neues_passwort"];
$var_mail = $_POST["neue_email"];
$datei = "benutzer/".$var_user.".lif";
$vorhanden = file_exists($datei);
// Wenn die Datei vorhanden ist soll er nicht weitermachen und einen Fehler ausgeben... andernfalls
// macht er mit der Prozedur weiter...
if(!$vorhanden) {
// Wenn der Registrieren Button gedrückt wurde macht er weiter...
if(isset($_POST["reg"])) {
// Einmal kurz prüfen ob die wichtigen Felder auch nicht leer waren...
if(!empty($var_user) && !empty($var_pass)) {
// Neue Datei schreiben mit Benutzerinformationen...
$eintrag = $var_user."§§".md5($var_pass)."§§".$var_mail;
$f = fopen($datei, "w");
fwrite($f, $eintrag);
fclose($f);
echo "Benutzer wurde hinzugefügt!";
header ("Refresh: 2, URL=index.php");
} else {
echo "Benutzer konnte nicht hinzugefügt werden!";
}
}
} else {
echo "Benutzer ist bereits vorhanden!";
}
?>
</td>
</tr>
</form>
</table>
</center>
</body>
</html>
Da sind keine fehler.
Fehler
Also schau mal in der createnew.php in der zeile 77Code:Parse error: syntax error, unexpected T_VARIABLE in /usr/export/www/vhosts/funnetwork/hosting/mafioso147/createnew.php on line 77
und ausserdem das beste daran finde ich ja die createnew.php ist ein php dokument, und du hast das als HTML dokument genommen, also das dokument ist eigentlich ein html dokument und darin sind lauter php befehle, ich hoffe du weißt was ich meine, aber auf jeden fall in der Zeile 77
änder das mal so umCode:$f = fopen($datei, "w");
Code:$f = fopen($datei, 'w');
ich hab immer noch ein fehler hab sogar foto gemacht unten ist der link
http://www.hostpix.de/file.php?dat=xmoZYdm2.JPG
existiert die datei createnew.php und ist chmod richtig gesetzt? Bzw. welche Rights hast du der Datei gegeben? r?r+?w?
wie mache ich das mit dem chomd ??
Welches FTP-Proggy benutzt du ?
//edit: naja ich bezweifel, dass es an chmod liegt ^^
file zilla
Rechtklick auf die Datei -> Dateiattribute
Stell mal testweise auf 777, aber daran kanns net liegen ;)
alle dateien
Added after 1 minutes:
das kommt immer noch
Wenn du einfachmal ne @ vor fwrite schreibst ?
Hallo,
existiert denn der Ordner benutzer?
Wenn ja versuch dem mal die Dateiattribute 777 zu geben.
Ansonsten probier einfach mal statt
Code:$f = fopen($datei, "w");
Zu benutzen.Code:$f = fopen($datei, "w+");
löl^^
das verzeichnis "benutzer" gibts nich.
leg es an und fertig is.
btw: mkdir benutzer
MfG RiDER