|
Login-Script fehlerhaft ? kann mich nicht einloggen
|
|
27.04.2005, 13:10
Beitrag: #1
|
|||
|
|||
|
Login-Script fehlerhaft ? kann mich nicht einloggen
Hy ich hab mir auf http://www.para-scripts.de das tutorial durchgelesen und darauf hin das script geschrieben . Hierbei handelt es sich um ein Login system mit mysql ! aber wenn ich mich jetzt ein logge dann kommt eine fehler meldung in der check.php (wo die formulareingabe ausgewehrtet wird) und darunter sie sind erfolgreich eingelogt ? wi das ? und wenn ich dort dann auf weiter gehe dann steht in der index (die passwort geschützte seite) dass ich mich nicht eingeloggt habe !
die fehler meldung heist : Zitat:Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /srv/www/htdocs/web3/html/acp/config.inc.php:10) in /srv/www/htdocs/web3/html/acp/check.php on line 3Also hier mein script : die check.php : [php:1]<?php include("config.inc.php"); session_start(); //---Abfrage-includeende---// if($login) { $name = $_POST['name']; $pass = $_POST['pass']; $pass = md5($pass); //---vergleichen---// $check = "SELECT * FROM `".$my_table."` WHERE name LIKE '".$name."' AND pass = '".$pass."'"; $check_result = mysql_query($check); $result = mysql_num_rows($check_result); //---prüfung---// if($result > 0) { $logedin = TRUE; session_register("logedin"); echo "Login erfolgreich!<br>Bitte klicken Sie <a href=\"./index.php\">hier</a> um zur Admin-Startseite zu gelangen."; } else { echo "Die Daten waren falsch."; } } ?> [/php:1] und hier die index.php : [php:1]<?php session_start(); if(session_is_registered("logedin") && $_SESSION['logedin']) { echo ' <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Webmastguide.de - AdminControlPanel</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> a:link { text-decoration: none; color:#3C5A74; } a:visited { text-decoration:none; color:#3C5A74; } a:hover { text-decoration: none; color:#8DB0CD; } <!-- .Stil1 { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; } .Stil2 {font-size: 12px; font-family: Geneva, Arial, Helvetica, sans-serif;} .Stil3 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; } .Stil4 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #333333; } .Stil6 {color: #CCCCCC} --> </style> </head> <body background="../images/bg.gif"> <div align="center"> <table width="800" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000"> <tr> <td height="80"><img src="images/header.jpg" width="800" height="80"></td> </tr> <tr> <td height="16" bgcolor="#99CC00"><div align="left" class="Stil1"> <table width="800" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="552"><span class="Stil6">- <a href="index.php?action=news">News</a> | <a href="index.php?action=downloads">Downloads</a> | <a href="index.php?action=tutorials">Tutorials</a> | <a href="index.php?action=scripte">Scripte</a> | <a href="index.php?action=guestbook">Gästebuch</a> | <a href="index.php?action=forum">Forum</a> | <a href="index.php?action=links">Links</a> | <a href="index.php?action=member">Member</a> | <a href="index.php?action=statistik">Statistik</a> | <a href="index.php?action=werbung">Werbung</a></span> </td> <td width="248"><div align="right" class="Stil6"><a href="logout.php" target="_blank">Logout</a> - </div></td> </tr> </table> </div></td> </tr> <tr> <td bgcolor="#FFFFFF"><blockquote><?php switch($action) { case "news": include("news/news.php"); break; case "downloads": include("downloads.php"); break; case "tutorials": include("tutorials.php"); break; case "scripte": include("scripte.php"); break; case "guestbook": include("guestbook.php"); break; case "forum": include("forum.php"); break; case "links": include("links.php"); break; case "member": include("member.php"); break; case "statistik": include("stat.php"); break; case "werbung": include("werbung.php"); break; default: include("start.php"); break; } ?> </blockquote></td> </tr> <tr> <td bgcolor="#99CC00"><table width="800" height="16" border="0" cellpadding="0" cellspacing="0"> <tr class="Stil2"> <td width="552">- © by Webmastguide.de </td> <td width="248"><div align="right"><span class="Stil3"><span class="Stil4"> <?php $timestamp = time(); $datum = date("d.m.Y - H:i", $timestamp); echo $datum." Uhr"; ?> </span></span> - </div></td> </tr> </table></td> </tr> </table> </div> </body> </html>'; } else { echo "Sie sind nicht eingeloggt."; } ?> [/php:1] was läuft hier falsch ? (irgendwas mit der session) |
|||
|
27.04.2005, 13:22
Beitrag: #2
|
|||
|
|||
|
das "<?php" muss DIEREKT am Anfang der Datei stehen, vorher darf keine Ausgabe erfolgen, also einfach die Leerzeilen löschen und es sollte gehen.
|
|||
|
27.04.2005, 13:44
Beitrag: #3
|
|||
|
|||
|
Nö. das ist egal ob davor etwas steht. Vielmehr musst du mal schaun, was du da so geschrieben hast. Du hast hier sehr viel PHP und HTML durcheinander gebracht. Da liegt vielmehr das Problem.
Entweder du machst alles per Echo oder du machst das in Intervallen. Aber so wie du das machst geht das nicht! Du musst das besser Strukturieren!
|
|||
|
27.04.2005, 13:48
Beitrag: #4
|
|||
|
|||
|
So könnte das vielleicht Klappen! Aber ich bin mir da nicht ganz sicher. Probier das doch einfach mal aus!
[php:1]<?php session_start(); ?> // Wichtig das die Session vor allem gestartet wird. Das ist das wichtigste! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Webmastguide.de - AdminControlPanel</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> a:link { text-decoration: none; color:#3C5A74; } a:visited { text-decoration:none; color:#3C5A74; } a:hover { text-decoration: none; color:#8DB0CD; } <!-- .Stil1 { font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; } .Stil2 {font-size: 12px; font-family: Geneva, Arial, Helvetica, sans-serif;} .Stil3 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; } .Stil4 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #333333; } .Stil6 {color: #CCCCCC} --> </style> </head> <?php if(session_is_registered("logedin") && $_SESSION['logedin']) { echo"?> <body background="../images/bg.gif"> <div align="center"> <table width="800" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000"> <tr> <td height="80"><img src="images/header.jpg" width="800" height="80"></td> </tr> <tr> <td height="16" bgcolor="#99CC00"><div align="left" class="Stil1"> <table width="800" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="552"><span class="Stil6">- <a href="index.php?action=news">News</a> | <a href="index.php?action=downloads">Downloads</a> | <a href="index.php?action=tutorials">Tutorials</a> | <a href="index.php?action=scripte">Scripte</a> | <a href="index.php?action=guestbook">G&auml;stebuch</a> | <a href="index.php?action=forum">Forum</a> | <a href="index.php?action=links">Links</a> | <a href="index.php?action=member">Member</a> | <a href="index.php?action=statistik">Statistik</a> | <a href="index.php?action=werbung">Werbung</a></span> </td> <td width="248"><div align="right" class="Stil6"><a href="logout.php" target="_blank">Logout</a> - </div></td> </tr> </table> </div></td> </tr> <tr> <td bgcolor="#FFFFFF"><blockquote> <?php switch($action) { case "news": include("news/news.php"); break; case "downloads": include("downloads.php"); break; case "tutorials": include("tutorials.php"); break; case "scripte": include("scripte.php"); break; case "guestbook": include("guestbook.php"); break; case "forum": include("forum.php"); break; case "links": include("links.php"); break; case "member": include("member.php"); break; case "statistik": include("stat.php"); break; case "werbung": include("werbung.php"); break; default: include("start.php"); break; } ?> </blockquote></td> </tr> <tr> <td bgcolor="#99CC00"><table width="800" height="16" border="0" cellpadding="0" cellspacing="0"> <tr class="Stil2"> <td width="552">- &copy; by Webmastguide.de </td> <td width="248"><div align="right"><span class="Stil3"><span class="Stil4"> <?php $timestamp = time(); $datum = date("d.m.Y - H:i", $timestamp); echo $datum." Uhr"; ?> </span></span> - </div></td> </tr> </table></td> </tr> </table> </div> </body> </html> <?php "; } else { echo "Sie sind nicht eingeloggt."; } ?> [/php:1]
|
|||
|
27.04.2005, 13:55
Beitrag: #5
|
|||
|
|||
|
@ephy doch es liegt an daran, das oben noch was drüber steht.
wenn vorher irgendwas an den browser gesendet wurde, können keine weiteren header, oder cookies mehr gesendet werden. Es sei denn man läd den alles in einen buffer. Das erreicht man, indem man ganz oben in seiner pphp datei ein ob_start(); reinschreibt ( einfachste variante ) MFG Axel http://www.axel-wahlen.de |
|||
|
|
| Möglicherweise verwandte Themen... | |||||
| Thema: | Verfasser | Antworten: | Ansichten: | Letzter Beitrag | |
| HTTP_ACCEPT_LANGUAGE geht nicht. | Sam Fisher | 2 | 185 |
10.01.2008 14:30 Letzter Beitrag: Sam Fisher |
|
| <script> für Contentnapping | RancoR | 2 | 307 |
06.05.2007 21:33 Letzter Beitrag: RancoR |
|
| news script | RancoR | 0 | 187 |
02.02.2007 18:26 Letzter Beitrag: RancoR |
|
| Stunden Banner Script ? | Tacado | 3 | 212 |
24.09.2006 15:56 Letzter Beitrag: Freshmaker_01 |
|
| Suche Such-Script | Takedown | 4 | 210 |
23.09.2006 17:03 Letzter Beitrag: Freshmaker_01 |
|
| Script verändert Schriftart | weed_killßr | 6 | 246 |
18.08.2006 12:36 Letzter Beitrag: Sam Fisher |
|
| Imagename an ein anderes PHP Script übergeben? | puma | 5 | 234 |
13.08.2006 17:36 Letzter Beitrag: puma |
|
| Query funktioniert nicht | Sam Fisher | 4 | 221 |
04.08.2006 19:01 Letzter Beitrag: White |
|
| PHP Include - Bilder werden nicht angezeigt. | dersu | 3 | 200 |
28.07.2006 09:06 Letzter Beitrag: ~Christian |
|
| Suche ein PHP-Stundenbanner-Script | Ingrid | 4 | 430 |
26.06.2006 09:47 Letzter Beitrag: Freshmaker_01 |
|





![[Bild: signatur_fotoblog.jpg]](http://lh6.google.com/image/e.phy05/RjeJC9rbNII/AAAAAAAAAs8/SATAq9a1tg0/signatur_fotoblog.jpg)
