Hilfe was ist an diesem Code falsch, ich dreh durch...
Verfasst: 30.05.2004 20:09
Hi,
jetzt ist mir die Lust vergangen, ich schaff es einfach nicht, ich bekomme ständig Fehlermeldungen, dabei will ich doch nur eine externe Seite durch Loginpflich im Forum schützen:
Danke im Voraus!
jetzt ist mir die Lust vergangen, ich schaff es einfach nicht, ich bekomme ständig Fehlermeldungen, dabei will ich doch nur eine externe Seite durch Loginpflich im Forum schützen:
Code: Alles auswählen
<html>
<head>
<title>Unbenanntes Dokument</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<?php
//Benötigte Dateien und Variablen von phpBB
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//Session auslesen und Benutzer-Informationen laden
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
?>
<body>
<?php
define('IN_PHPBB',true);
$phpbb_root_path = "./"; // set path to phpBB files
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userid = $userdata['user_id'];
$sql = "SELECT * FROM " . USER_GROUP_TABLE . " WHERE user_id = '$userid'";
$result = $db->sql_query($sql);
$isauth = 0;
while ($row = $db->sql_fetchrow($result))
{
if ($row['group_id'] == 'insert_group_id_here' || $row['group_id'] == 'insert_group_id_here')
{
$isauth = 1;
}
}
if($userdata['session_logged_in']){
?>
<div align="left">
<center>
<font size="1" face="Verdana">Hallo, <?php echo $userdata[username] ?>! </font>
</center>
</div>
<br>
<div class="nav"><font face="Verdana"><font size="1">:: </font> <a class="nav" href="http://www.xyz.de/phpBB2/profile.php?mode=editprofile">
<font size="1">Profil bearbeiten</font></a></font></div>
<div class="nav"><font face="Verdana"><font size="1">:: </font> <a class="nav" href="http://www.xyz.de/phpBB2/privmsg.php?folder=inbox">
<font size="1">Private Nachrichten</font></a></font></div>
<div class="nav"><font face="Verdana"><font size="1">:: </font> <a class="nav" href="http://www.xyz.de/phpBB2/login.php?logout=true&redirect=../index.php">
<font size="1">Ausloggen</font></a></font></div>
<font size="1" face="Verdana">
<?php
}else{
?>
</font>
<form action="http://www.xyz.de/phpBB2/login.php" method="post">
<table border="0" cellpadding="3" cellspacing="1" width="100%">
<tr>
<td> <font size="1" face="Verdana">Username:<br>
<input class="searchbox" type="text" name="username" size="10" maxlength="40">
</font> </td>
</tr>
<tr>
<td> <font size="1" face="Verdana">Passwort:<br>
<input class="searchbox" type="password" name="password" size="10" maxlength="25">
</font><br> <font size="1" face="Verdana">Auto Login: </font> <font face="Verdana" size="1">
<input class="text" type="checkbox" name="autologin">
</font><br> </td>
</tr>
<tr align="center">
<td colspan="2"><font size="1" face="Verdana">
<input type="submit" name="login" value="Login">
</font></td>
</tr>
<tr align="center">
<td colspan="2"><font face="Verdana"><span class="smalltext"> <font size="1">
<a href="http://www.xyz.de/phpBB2/profile.php?mode=sendpassword" class="smalllink">Passwort
vergessen?</a></font></span><br>
<font size="1"> <a href="http://www.xyz.de/phpBB2/profile.php?mode=register">Registrieren</a></font><font size="1">!
</font></font></td>
</tr>
</table>
<input type="hidden" name="redirect" value="../index.php">
</form>
<?php
}
?>
</body>
</html>