slipknoter6
Neues Mitglied
also hier mal der code wo der fehler ist
als error kommt das hier Parse error: syntax error, unexpected T_IF in C:\xampp\htdocs\DJPsycho\ucp.php on line 77
zeile 77 ist if($row->password == $passwort)
der code ist abgeändert von ein register system das sieht so aus
kann mir da einer helfen??
PHP:
<?php
include("config.php");
error_reporting(E_ALL ^ E_NOTICE);
session_start();
$msg = Array();
$error = Array();
function Login(){
if (empty($_POST)) return false;
global $config, $msg, $error;
if (empty($_POST['login'])) $error[] = 'Bitte Accountname eingeben!';
if (empty($_POST['password'][0]) || empty ($_POST['password'][1])) $error[] = 'Bitte Passwort eingeben!';
if (!empty($error)) return false;
$db = @mysql_connect($config['mysql_host'], $config['mysql_user'], $config['mysql_pass']);
if (!$db) return $error[] = 'Database: '.mysql_error();
if (!@mysql_select_db($config['mysql_dbname'], $db)) return $error[] = 'Database: '.mysql_error();
$query = "SELECT login, password FROM `accounts` WHERE `login` = '".mysql_real_escape_string($_POST['login'])."'";
$res = mysql_query($query, $db);
if (!$res) return $error[] = 'Database: '.mysql_error();
$username = $_POST["login"];
$passwort = md5($_POST["password"]);
$ergebnis = mysql_query($query);
$row = mysql_fetch_object($ergebnis)
if($row->password == $passwort)
{
$_SESSION["login"] = $username;
echo "Login erfolgreich. <br> <a href=\"geheim.php\">Geschützer Bereich</a>";
}
else
{
echo "Benutzername und/oder Passwort waren falsch. <a href=\"ucp.html\">Login</a>";
}
}
{
Login();
}
?>
zeile 77 ist if($row->password == $passwort)
der code ist abgeändert von ein register system das sieht so aus
PHP:
<?php
include("config.php");
error_reporting(E_ALL ^ E_NOTICE);
session_start();
$msg = Array();
$error = Array();
function addUser(){
if (empty($_POST)) return false;
global $config, $msg, $error;
if (empty($_POST['login'])) $error[] = 'Bitte Accountname eingeben!';
if (empty($_POST['password'][0]) || empty ($_POST['password'][1])) $error[] = 'Bitte Passwort eingeben!';
if (($_POST['password'][0]) !== ($_POST['password'][1])) $error[] = 'Das Passwort stimmt nicht überein!';
if (empty($_POST['email'])) $error[] = 'Bitte E-Mail Adresse eingeben!';
if (!empty($error)) return false;
$db = @mysql_connect($config['mysql_host'], $config['mysql_user'], $config['mysql_pass']);
if (!$db) return $error[] = 'Database: '.mysql_error();
if (!@mysql_select_db($config['mysql_dbname'], $db)) return $error[] = 'Database: '.mysql_error();
$query = "SELECT `acct` FROM `accounts` WHERE `login` = '".mysql_real_escape_string($_POST['login'])."'";
$res = mysql_query($query, $db);
if (!$res) return $error[] = 'Database: '.mysql_error();
if (mysql_num_rows($res) > 0) return $error[] = 'Accountname wird bereits verwendet!';
//Modified by Jerq
$query = "INSERT INTO `accounts` (`login`,`password`,`lastip`,`email`) VALUES ('".mysql_real_escape_string($_POST['login'])."', '".mysql_real_escape_string (md5($_POST['password'][0]))."', '".$_SERVER['REMOTE_ADDR']."','".mysql_real_escape_string($_POST['email'])."')";
//Modified by Jerq
$res = mysql_query($query, $db);
if (!$res) return $error[] = 'Database: '.mysql_error();
$msg[] = 'Der Account <span style="color:#00FF00"><strong>'.htmlentities($_POST['login']).'</strong></span> wurde erstellt!';
mysql_close($db);
return true;
}
{
addUser();
}
?>