000
29.04.2010, 18:32 Uhr
Arzi
|
Hallo Ich habe eine Session gestartet und dann kommt vollgendes bei raus, wenn man nur den URL eingibt.... Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0
Hier der Code:
Code: |
<?php session_name("Loginbereich"); session_start(); $nick = $_POST['nick']; $passwort = $_POST['passwort']; $passwort = md5($passwort); if(isset($_POST['Einloggen'])){ $_SESSION['name'] = (!empty($nick)) ? $nick : 'leer'; $_SESSION['passwort'] = (!empty($passwort)) ? $passwort : 'leer'; }else{ $_SESSION['name'] = ($_SESSION['name'] != 'empty') ? $_SESSION['name'] : 'leer'; $_SESSION['passwort'] = ($_SESSION['passwort'] != 'empty') ? $_SESSION['passwort'] : 'leer'; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Klassenhomepage der 9b</title> <?php include("head.inc.php"); ?> </head> <body> <?php $db = mysqli_connect('localhost', 'd00cac45', 'Passwort', 'd00cac45'); $sql_nick = "SELECT nick FROM login"; $sql_passwort = "SELECT passwort FROM login"; $erg_nick = mysqli_query($db, $sql_nick); $erg_passwort = mysqli_query($db, $sql_passwort); mysqli_close($db); while ($p_nick = mysqli_fetch_array($erg_nick)) { $fetch_nick = $p_nick['nick']; } if($_SESSION['name'] == $fetch_nick){ $p_nick = '1'; }else{ $p_nick = '0'; } while ($p_passwort = mysqli_fetch_array($erg_passwort)) { $fetch_passwort = $p_passwort['passwort']; } if($_SESSION['passwort'] == $fetch_passwort){ $p_passwort = '1'; }else{ $p_passwort = '0'; } if($p_nick && $p_passwort){ //echo "{$_SESSION['name']}<br>\n"; //echo $_SESSION['passwort']; ?> <div class="Seite"> Hier die Seite, wenn der Nick und das Passwort richtig ist... </div> <?php }else{ echo "Passwort/Nick falsch... oder einfach nur URL eingegeben..."; } ?> </body> </html>
|
|