Also ich poste hier jetzt einfach mal die index datei mit der ich die login.php include und dann die login.php und danach den fehler!!!
index.php:
login.php:
und den fehler beim einloggen:
Wäre toll wenn einer mir ne verbesserung posten könnte
index.php:
Code:
<?php include('inc/connect.inc.php'); include('inc/functions.inc.php'); $output='<html><head><title></title><meta name="author" content="Sebs"><link rel="stylesheet" type="text/css" href="style/main.css"></head>'; $output.='<body text="#000000" bgcolor="#2F476F" link="#FFFFFF" alink="#FFFFFF" vlink="#FFFFFF">'; $output.='<table cellpadding="0" cellspacing="0" border="0" width="100%">'; $output.='<tr height="240" valign="top">'; $output.='<td width="256" align="left">'; $output.='[img]menu/left_top2.gif[/img]'; $output.='</td>'; $output.='<td width="512" align="center">'; $output.='[img]menu/middle_top.gif[/img]'; $output.='</td>'; $output.='<td width="256" align="right">[img]menu/right_top2.gif[/img]</td>'; $output.='</tr>'; $output.='<tr height="300"><td width="256" align="left" valign="top">'; $output.='[img]menu/menu_main_top.gif[/img]'; $output.='<table cellpadding="0" cellspacing="0" border="0" valign="top"><tr><td colspan="2" height="20"></td></tr>'; $output.='<tr><td width="20" background="menu/menu_main_bg.gif" valign="top"></td>'; $output.='<td width="236">'; $output.='<span class="menu">'.menu('main', 'links').'</span>'; $output.='</td>'; $output.='</tr>'; $output.='</table>'; $output.=' '; $output.='[img]menu/menu_main_bottom.gif[/img]'; $output.='</td>'; $output.='<td width="512" valign="top">'; $output2.='</td>'; $output2.='<td width="256" align="right" valign="top">'; $output2.='[img]menu/menu_int_top.gif[/img]'; $output2.='<table cellpadding="0" cellspacing="0" border="0" valign="top"><tr><td colspan="2" height="20"></td></tr>'; $output2.='<tr><td width="220" align="right">'; $output2.='<span class="menu">'.menu('int_logoff', 'rechts').'</span>'; $output2.='</td>'; $output2.='<td width="20" background="menu/menu_main_bg.gif" valign="top"></td></tr></table> '; $output2.='[img]menu/menu_int_bottom.gif[/img]</td></tr></table></body></html>'; echo $output; if($_REQUEST['module'] == "" || !isset($_REQUEST['module'])){ include('home.php'); }elseif(isset($_REQUEST['module'])){ include($_REQUEST['module'].'.php'); } echo $output2; ?>
Code:
<?php if($_SESSION['login'] == "" || !isset($_SESSION['login'])){ ?> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td> [img]menu/head_of_table.gif[/img] </td> </tr> <tr> <td background="menu/table_background.gif"> <ul>:: Login <?php if(!isset($_REQUEST['submit'])){ ?> <form name="login" method="POST"> Stufianer: <input name="name" type="text" class="input"> Passwort: <input name="passwort" type="password" class="input"> <input type="hidden" name="time" value="<?php echo time(); ?>"> <input type="submit" name="submit" value="Login" class="button"> </form> passwort vergessen ? <?php //Sind alle Daten richtig? }elseif(!isset($_POST['name']) || $_POST['name'] == ""){ echo 'Kein Stufianernick angegeben! :: zurück'; }elseif(!isset($_POST['passwort']) || $_POST['passwort'] == ""){ echo 'Kein Passwort angegeben! :: zurück'; //Alle Felder haben Inhalt! }else{ $name = $_POST['name']; // Einfacherere Variablennamen $password = $_POST['passwort']; $password = md5($password); // Password wird verschlüsselt in md5 //Existiert der Benutzer? $query = mysql_query("SELECT id,nickname,password FROM user WHERE nickname='".$name."'"); if($query == ""){ echo'Der Stufianer existiert net! :: zurück'; }else{ $result = @mysql_fetch_array($query); if($result == ""){ echo 'Datenbankfehler. Kontaktiere mich bitte! :: zurück'; }else{ //Benutzer existiert! if($password != $result['password']){ echo 'Falsches Passwort!! :: zurück'; exit; }else{ $id = $result['id']; $login = '1'; session_start(); $_SESSION['id']=$id; $_SESSION['login']='1'; $_SESSION['name']=$name; echo $_SESSION['login']; echo '<meta http-equiv="refresh" content="0; URL=index.php?module=home">'; } } } } } ?> [/list] </td> </tr> <tr> <td> [img]anmelden.php[/img] </td> </tr> </table>
Code:
Warning: Cannot send session cookie - headers already sent by (output started at /home/www/web26/html/abi_new/index.php:38) in /home/www/web26/html/abi_new/login.php on line 51 Warning: Cannot send session cache limiter - headers already sent (output started at /home/www/web26/html/abi_new/index.php:38) in /home/www/web26/html/abi_new/login.php on line 51
Kommentar