Hallo,
folgendes Problem:
ich habe mir das phpbb-Forum installiert und wollte da das pafiledb-download-script einbauen und anpassen. Das heißt ich wollte eigentlich nur den Header vom phpbb-Forum einbauen...
Ok, soweit habe ich das fertig, allerdings kann ich mich nicht in das Admin Center von pafiledb einloggen, da ich immer diese Header-Error-Meldung bekomme.
Zitat:
|
Cannot modify header information - headers already sent by
|
Diese Fehlermeldung ist mir schon ein paar Stunden vorher erschienen und zwar als meine download.php angepasst habe. Hier habe ich es allerdings in den Griff bekommen, mittels:
PHP-Code:
<?php
if (!headers_sent($filename, $linenum)) {
header ("Location: $file[file_dlurl]");
exit;
} else {
echo" <script language=javascript>";
echo" document.location.href = '$file[file_dlurl]';";
echo"</script>";
echo"<noscript>Du hast kein Java Script aktiviert! [url='$file[file_dlurl]']Klick hier[/url], um den Download manuell zu starten.";
echo"</noscript>";
exit;
}
?>
Nun wollte ich wie gesagt es genauso machen, doch hier funktioniert es nicht. Deshalb hier mal der Original Code:
PHP-Code:
<?php
/*
paFileDB 3.1
©2001/2002 PHP Arena
Written by Todd
[email]todd@phparena.net[/email]
[url]http://www.phparena.net[/url]
Keep all copyright links on the script visible
Please read the license included with this script for more information.
*/
if ($showerr == "1") {
?>
<table width="100%" border="1" cellpadding="2" cellspacing="0" class="headertable" bordercolor="#000000">
<tr><td width="100%" colspan="2" class="headercell"><center>[b]<?php echo $str[login]; ?>[/b]</center></td></tr>
<tr><td width="5%" class="datacell" align="center" valign="middle">[img]styles/<?php echo $config[11]; ?>/images/error.gif[/img]</td>
<td width="95%" class="datacell"><?php echo $str[loginerror]; ?></td></tr></table><table width="100%" border="1" cellpadding="2" cellspacing="0" class="headertable" bordercolor="#000000">
<form action="pafiledb.php" method="post">
<tr><td width="50%" align="right" class="datacell"><?php echo $str[username]; ?></td><td width="50%" align="left" class="datacell"><input type="text" size="50" name="formname" class="forminput"></td></tr>
<tr><td width="50%" align="right" class="datacell"><?php echo $str[password]; ?></td><td width="50%" align="left" class="datacell"><input type="password" size="50" name="formpass" class="forminput"></td></tr>
<tr><td width="50%" align="center" class="datacell" colspan="2"><input type="submit" value=">> <?php echo $str[login]; ?> <<" name="B1"><input type="hidden" name="action" value="admin"><input type="hidden" name="login" value="do"></td></tr>
</form>
</table>
<?php
exit();
}
if ($login == "do") {
$admin = $pafiledb_sql->query($db, "SELECT * FROM $db[prefix]_admin WHERE admin_username = '$formname'", 1);
$formpw = md5($formpass);
if ($formpw == $admin[admin_password]) {
$adminip = getenv ("REMOTE_ADDR");
$ip = md5($adminip);
$user = $formname;
$pass = $formpw;
if ($authmethod == "cookies") {
$cookiedata = "$ip|$formname|$formpw";
setcookie("pafiledbcookie", $cookiedata);
}
header("Location: admin.php");
} else {
header("Location: pafiledb.php?action=admin&ad=login&showerr=1");
}
} else {
?>
<table width="100%" border="1" cellpadding="2" cellspacing="0" class="headertable" bordercolor="#000000">
<form action="pafiledb.php" method="post"><tr><td width="100%" colspan="2" class="headercell"><center>[b]<?php echo $str[login]; ?>[/b]</center></td></tr>
<tr><td width="50%" align="right" class="datacell"><?php echo $str[username]; ?></td><td width="50%" align="left" class="datacell"><input type="text" size="50" name="formname" class="forminput"></td></tr>
<tr><td width="50%" align="right" class="datacell"><?php echo $str[password]; ?></td><td width="50%" align="left" class="datacell"><input type="password" size="50" name="formpass" class="forminput"></td></tr>
<tr><td width="50%" align="center" class="datacell" colspan="2"><input type="submit" value=">> <?php echo $str[login]; ?> <<" name="B1"><input type="hidden" name="action" value="admin"><input type="hidden" name="login" value="do"></td></tr>
</form>
</table>
<?php
}
?>
Und hier, wie ich es geändert habe:
PHP-Code:
<?php
/*
paFileDB 3.1
©2001/2002 PHP Arena
Written by Todd
[email]todd@phparena.net[/email]
[url]http://www.phparena.net[/url]
Keep all copyright links on the script visible
Please read the license included with this script for more information.
*/
if ($showerr == "1") {
?>
<table width="100%" border="1" cellpadding="2" cellspacing="0" class="headertable" bordercolor="#000000">
<tr><td width="100%" colspan="2" class="headercell"><center>[b]<?php echo $str[login]; ?>[/b]</center></td></tr>
<tr><td width="5%" class="datacell" align="center" valign="middle">[img]pafiledb/styles/<?php echo $config[11]; ?>/images/error.gif[/img]</td>
<td width="95%" class="datacell"><?php echo $str[loginerror]; ?></td></tr></table><table width="100%" border="1" cellpadding="2" cellspacing="0" class="headertable" bordercolor="#000000">
<form action="pafiledb/pafiledb.php" method="post">
<tr><td width="50%" align="right" class="datacell"><?php echo $str[username]; ?></td><td width="50%" align="left" class="datacell"><input type="text" size="50" name="formname" class="forminput"></td></tr>
<tr><td width="50%" align="right" class="datacell"><?php echo $str[password]; ?></td><td width="50%" align="left" class="datacell"><input type="password" size="50" name="formpass" class="forminput"></td></tr>
<tr><td width="50%" align="center" class="datacell" colspan="2"><input type="submit" value=">> <?php echo $str[login]; ?> <<" name="B1"><input type="hidden" name="action" value="admin"><input type="hidden" name="login" value="do"></td></tr>
</form>
</table>
<?php
exit();
}
if ($login == "do") {
$admin = $pafiledb_sql->query($mydb, "SELECT * FROM $mydb[prefix]_admin WHERE admin_username = '$formname'", 1);
$formpw = md5($formpass);
if ($formpw == $admin[admin_password]) {
$adminip = getenv ("REMOTE_ADDR");
$ip = md5($adminip);
$user = $formname;
$pass = $formpw;
if ($authmethod == "cookies") {
$cookiedata = "$ip|$formname|$formpw";
setcookie("pafiledbcookie", $cookiedata);
}
if (!headers_sent())
{
header("Location: admin.php");
}
else
{
echo" <script language=javascript>";
echo" document.location.href = 'admin.php';";
echo"</script>";
exit;
}
} else {
header("Location: pafiledb.php?action=admin&ad=login&showerr=1");
}
} else {
?>
<table width="100%" border="1" cellpadding="2" cellspacing="0" class="headertable" bordercolor="#000000">
<form action="pafiledb/pafiledb.php" method="post"><tr><td width="100%" colspan="2" class="headercell"><center>[b]<?php echo $str[login]; ?>[/b]</center></td></tr>
<tr><td width="50%" align="right" class="datacell"><?php echo $str[username]; ?></td><td width="50%" align="left" class="datacell"><input type="text" size="50" name="formname" class="forminput"></td></tr>
<tr><td width="50%" align="right" class="datacell"><?php echo $str[password]; ?></td><td width="50%" align="left" class="datacell"><input type="password" size="50" name="formpass" class="forminput"></td></tr>
<tr><td width="50%" align="center" class="datacell" colspan="2"><input type="submit" value=">> <?php echo $str[login]; ?> <<" name="B1"><input type="hidden" name="action" value="admin"><input type="hidden" name="login" value="do"></td></tr>
</form>
</table>
<?php
}
?>
Nun komme ich immer wieder zur LoginMaske, d.h. ich kann mich zwar einloggen und absenden, aber es springt immer wieder zurück und ich komme nicht in das Admin Center.
Wer hat eine Idee, wie man das realisieren könnte, um in das Admin Center zu kommen?
Wäre für jeden Vorschlag dankbar.