Hab hier n loginsystem... ne datenbank mit id, username, password und email... das ding soweit... wenn ich falsches passwort und username eingeb dann kommt Zugang verweigert << passt auch noch... allerdings wenn ich das passwort und den username richtig eingeb bekomm ich 4 errors... mit denen ich nix anfangen kann...
Warning: Cannot modify header information - headers already sent by (output started at /home/www/htdocs/extol-net.de/my-misery/index.php:10) in /home/www/htdocs/extol-net.de/my-misery/connect.php on line 14
Warning: Cannot modify header information - headers already sent by (output started at /home/www/htdocs/extol-net.de/my-misery/index.php:10) in /home/www/htdocs/extol-net.de/my-misery/connect.php on line 15
Warning: Cannot modify header information - headers already sent by (output started at /home/www/htdocs/extol-net.de/my-misery/index.php:10) in /home/www/htdocs/extol-net.de/my-misery/connect.php on line 16
Warning: Cannot modify header information - headers already sent by (output started at /home/www/htdocs/extol-net.de/my-misery/index.php:10) in /home/www/htdocs/extol-net.de/my-misery/connect.php on line 17
habt ihr mir vielleicht n tip was ich aendern muss?
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
Warning: Cannot modify header information - headers already sent by (output started at /home/www/htdocs/extol-net.de/my-misery/index.php:10) in /home/www/htdocs/extol-net.de/my-misery/connect.php on line 14
Warning: Cannot modify header information - headers already sent by (output started at /home/www/htdocs/extol-net.de/my-misery/index.php:10) in /home/www/htdocs/extol-net.de/my-misery/connect.php on line 15
Warning: Cannot modify header information - headers already sent by (output started at /home/www/htdocs/extol-net.de/my-misery/index.php:10) in /home/www/htdocs/extol-net.de/my-misery/connect.php on line 16
Warning: Cannot modify header information - headers already sent by (output started at /home/www/htdocs/extol-net.de/my-misery/index.php:10) in /home/www/htdocs/extol-net.de/my-misery/connect.php on line 17
habt ihr mir vielleicht n tip was ich aendern muss?
Code:
//login_admin.php
<table width="600" border="0">
<tr>
<td colspan="4"><div class='head'>Administrator Login</div></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td colspan="4">
<?
if(!empty($_COOKIE['login_user']))
{
header("Location: index.php?action=Admin");
}
?>
<form action ="index.php?action=Connect" method="post">
<input name="username" type="text" class="input" onFocus="if(this.value=='Username')this.value='';"onBlur="if(this.value=='')this.value='Username';" value="Username" size="14"><br>
<input name="password" type="password" class="input" onFocus="if(this.value=='Password')this.value='';"onBlur="if(this.value=='')this.value='Password';" value="Password" size="14"><br><br>
<input name="submit" type="submit" class="input" value="Login">
</form>
</td>
</tr>
</table>
Code:
<?
// connect.php
include('db_config.php');
mysql_connect ($server,$user,$pass) or die ("Keine Verbindung moeglich");
mysql_select_db ("$datenbank") or die ("Die Datenbank existiert nicht");
$cookietime = "86400";
$abfrage = "SELECT id, username, password, email FROM mm_admin WHERE username = '".$_POST['username']."' and password = '".$_POST['password']."'";
$ergebnis = mysql_query($abfrage);
if(mysql_num_rows($ergebnis))
{
while($row=mysql_fetch_object($ergebnis))
{
setcookie("login", "sperren", time()+$cookietime);
setcookie("login_user", $_POST['username'], time()+$cookietime);
setcookie("login_pass", $_POST['password'], time()+$cookietime);
header("Location: index.php?action=Admin");
}
}
else
{
echo"<table width='600' border='0'>";
echo"<tr>";
echo"<td><div class='head'>Administrator Bereich</div></td>";
echo"</tr>";
echo"<tr>";
echo"<td> </td>";
echo"</tr>";
echo"<tr>";
echo"<td>Zugang verweigert!</td>";
echo"</tr>";
echo"</table>";
}
?>
Code:
<?
//admin.php
if(!empty($_COOKIE['login_user']))
{
echo"<table width='600' border='0'>";
echo"<tr>";
echo"<td><div class='head'>Administrator Bereich</div></td>";
echo"</tr>";
echo"<tr>";
echo"<td> </td>";
echo"</tr>";
echo"<tr>";
echo"<td>Willkommen blabla, ".$_COOKIE['login_user']."!</td>";
echo"</tr>";
echo"<tr>";
echo"<td> </td>";
echo"</tr>";
echo"<tr> ";
echo"<td><div class='head'>News</div></td>";
echo"</tr>";
echo"<tr> ";
echo"<td><a href='index.php?action=News_Entry'>Eintrag</a></td>";
echo"</tr>";
echo"<tr> ";
echo"<td><a href='index.php?action=News_Edit_List'>Bearbeiten</a></td>";
echo"</tr>";
echo"<tr>";
echo"<td><a href='index.php?action=News_Delete'>Löschen</a></td>";
echo"</tr>";
echo"</table>";
}
else
{
echo"Sie sind nicht eingeloggt.<br>Klicken Sie <a href='index.php?action=Admin'>hier</a> um sich einzuloggen.";
}
?>