PSD-Tutorials.de
Forum für Design, Fotografie & Bildbearbeitung
Tutkit
Agentur
Hilfe
Kontakt
Start
Forum
Aktuelles
Besonderer Inhalt
Foren durchsuchen
Tutorials
News
Anmelden
Kostenlos registrieren
Aktuelles
Suche
Suche
Nur Titel durchsuchen
Von:
Menü
Anmelden
Kostenlos registrieren
App installieren
Installieren
JavaScript ist deaktiviert. Für eine bessere Darstellung aktiviere bitte JavaScript in deinem Browser, bevor du fortfährst.
Du verwendest einen veralteten Browser. Es ist möglich, dass diese oder andere Websites nicht korrekt angezeigt werden.
Du solltest ein Upgrade durchführen oder einen
alternativen Browser
verwenden.
Antworten auf deine Fragen:
Neues Thema erstellen
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
PHP, Javascript, jQuery, Ajax, nodeJS, MySQL...
[PHP] header location
Beitrag
<blockquote data-quote="AlexanderBo" data-source="post: 1472417" data-attributes="member: 293817"><p><strong>AW: [PHP] header location[/b]</strong></p><p><strong></strong></p><p><strong>[quote="taffrot, post: 1472391"]jo, also vor der Fehlermeldung steht im Quelltext:</strong></p><p><strong></strong></p><p><strong>die Klasse user.php (dort tritt der eigentliche Fehler auf)</strong></p><p><strong>[php]</strong></p><p><strong>class user {</strong></p><p><strong> </strong></p><p><strong> function Login($username, $passwort) {</strong></p><p><strong> include('config/config.php');</strong></p><p><strong> </strong></p><p><strong> </strong></p><p><strong></strong></p><p><strong> //Datensätze überprüfen</strong></p><p><strong> $sql = "SELECT * FROM ".$database.".js_users WHERE </strong></p><p><strong> (Username like '".$username."') AND </strong></p><p><strong> (Password = '".md5 ($passwort)."')"; </strong></p><p><strong> $result = mysql_query($sql); </strong></p><p><strong> </strong></p><p><strong> //Benutzer gefunden && Benutzerdaten stimmen </strong></p><p><strong> if(mysql_num_rows($result) > 0) {</strong></p><p><strong> </strong></p><p><strong> $data = mysql_fetch_array ($result); </strong></p><p><strong></strong></p><p><strong> //Session Variabeln setzen</strong></p><p><strong> $_SESSION['userid'] = $data['ID'];</strong></p><p><strong> $_SESSION['username'] = $data['Username'];</strong></p><p><strong> $_SESSION['email'] = $data['Email'];</strong></p><p><strong> $_SESSION['group'] = $data['Benutzergruppe'];</strong></p><p><strong> </strong></p><p><strong> header('Location: profil.php'); </strong></p><p><strong> </strong></p><p><strong> } else {</strong></p><p><strong> header('Location: login.php?errmsg=1');</strong></p><p><strong> } </strong></p><p><strong></strong></p><p><strong> [/php]und das <head> tag</strong></p><p><strong>[php]</strong></p><p><strong><?php</strong></p><p><strong>session_start();</strong></p><p><strong>?></strong></p><p><strong><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"></strong></p><p><strong><html xmlns="http://www.w3.org/1999/xhtml"></strong></p><p><strong><head></strong></p><p><strong><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></strong></p><p><strong><link rel="stylesheet" type="text/css" href="css/main.css" /></strong></p><p><strong><script type="text/javascript" src="js/jquery.js"></script></strong></p><p><strong></strong></p><p><strong><title>JSystems - Youtube Mediathek</title></strong></p><p><strong><?php</strong></p><p><strong></strong></p><p><strong>//Includen</strong></p><p><strong> include('classes/database.php');</strong></p><p><strong> include('classes/user.php');</strong></p><p><strong> include('classes/common.php');</strong></p><p><strong>//Datenbankverbindung aufbauen</strong></p><p><strong> database::connect();</strong></p><p><strong> </strong></p><p><strong>//URL auslesen, ob logout erfolgen soll </strong></p><p><strong> if((isset($_GET['action'])) and ($_GET['action'] == "logout")) {</strong></p><p><strong> user::logout();</strong></p><p><strong> }</strong></p><p><strong>[/php]</strong></p></blockquote><p><strong></strong></p><p><strong></strong></p><p><strong></strong></p><p><strong>hau die beiden <?php ?> zusannem und das html-doctype+ co erst danach rein...</strong></p><p><strong>selbst <strong>das</strong> is ein output...</strong></p><p>[/QUOTE]</p>
[QUOTE="AlexanderBo, post: 1472417, member: 293817"] [b]AW: [PHP] header location[/b] [quote="taffrot, post: 1472391"]jo, also vor der Fehlermeldung steht im Quelltext: die Klasse user.php (dort tritt der eigentliche Fehler auf) [php] class user { function Login($username, $passwort) { include('config/config.php'); //Datensätze überprüfen $sql = "SELECT * FROM ".$database.".js_users WHERE (Username like '".$username."') AND (Password = '".md5 ($passwort)."')"; $result = mysql_query($sql); //Benutzer gefunden && Benutzerdaten stimmen if(mysql_num_rows($result) > 0) { $data = mysql_fetch_array ($result); //Session Variabeln setzen $_SESSION['userid'] = $data['ID']; $_SESSION['username'] = $data['Username']; $_SESSION['email'] = $data['Email']; $_SESSION['group'] = $data['Benutzergruppe']; header('Location: profil.php'); } else { header('Location: login.php?errmsg=1'); } [/php]und das <head> tag [php] <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="css/main.css" /> <script type="text/javascript" src="js/jquery.js"></script> <title>JSystems - Youtube Mediathek</title> <?php //Includen include('classes/database.php'); include('classes/user.php'); include('classes/common.php'); //Datenbankverbindung aufbauen database::connect(); //URL auslesen, ob logout erfolgen soll if((isset($_GET['action'])) and ($_GET['action'] == "logout")) { user::logout(); } [/php][/quote] hau die beiden <?php ?> zusannem und das html-doctype+ co erst danach rein... selbst [B]das[/B] is ein output...[/b] [/QUOTE]
Bilder bitte
hier hochladen
und danach über das Bild-Icon (Direktlink vorher kopieren) platzieren.
Zitate einfügen…
Authentifizierung
Wenn ▲ = 5, ▼ = 2 und ■ = 7, was ist ▲ × ▼ + ■?
Antworten
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
PHP, Javascript, jQuery, Ajax, nodeJS, MySQL...
[PHP] header location
Oben