topflight Posted February 19, 2009 Share Posted February 19, 2009 This is the first time I am receiving this error. Notice: Undefined index: login in C:\xampp\htdocs\blogin.php on line 13 This is my code: <? session_start(); ?> <? if($_SESSION['SESS_LOGGEDIN'] = TRUE){ include'db.php'; $connect = mysql_connect($db_host,$db_username,$db_password) or die("MySQL Said:".mysql_error()); $database = mysql_select_db($db_database,$connect) or die("MySQl Said:".mysql_error()); $slogin = $_SESSION['login']; $elink = mysql_query("SELECT * FROM `pilots` where login='$slogin'") or die("MySQL Said:".mysql_error()); $edata = mysql_fetch_assoc($elink); $lname = $edata["lname"]; $hub = $edata["hub"]; $pwd = $edata["pwd"]; $fname = $edata["fname"]; $login= $edata["login"]; $status= $edata["status"]; $enewp = mysql_query("SELECT * FROM `pilots` where status ='0'") or die("MySQL Said:".mysql_error()); $enewprow = mysql_num_rows($enewp); $eresult = count($enewp); if($edata['status'] == 0) { echo '<center>Your Account Is Not Active.</center>'; } elseif($edata['status'] == 2) { echo '<center><FONT COLOR =ff001b>Your Account Has Been Suspended.</center></FONT COLOR>';?> <center><a href="logout.php">Log Out</a></br></center> <? } elseif($edata['status'] == 3) { echo '<center>You Are Currently On L.O.A</center>';?> <a href="rfileloa.php?login=<? echo "{$edata["login"]}"?>">Return From L.O.A</a></br><? } else { ?> <body link="#0066FF" vlink="#0066FF" alink="#0066FF"> <center>Welcome Back <? echo"$fname"; ?> <? echo"$lname"; ?></center> <center> <h7><i><b>Pilots Panel</b></i></h7></br> <a href="?page=pirepform&lname=<? echo "{$edata["lname"]}"?>">File Pirep</a></br> <a href="?page=fileloa&login=<? echo "{$edata["login"]}"?>">File LOA</a></br> <a href="#">Signatures</a></br> <A HREF="?page=profile&login=<? echo "{$edata["login"]}"?> ">My Profile</a></br> <a href="?page=editp&login=<? echo "{$edata["login"]}"?>">Edit My Profile</a></br> <a href="?page=events">Events</a></br> <a href="?page=rosterphp">VIew Roster</a></br> <a href="#"><font color="#FF0000">Resignation Form</font Color></br> <a href="logout.php">Log Out</a></br> <br> <h7><i><b>Pilots Tools</b></i></h7></br> <a href="http://www.fspassengers.com/"> FS Passengers</a></br> </center> <?php if($edata['hm'] == 1) {?> <center> <h7><i><b>Hub Manager Panel</b></i></h7></br> <a href="edithub.php?hub=<?php echo $edata['hub']; ?>">Edit Hub Page</a></br> <a href="apppireps.php?hub=<?php echo $edata['hub']; ?>">Approve Pireps</a></br> <a href="promote.php?hub=<?php echo $edata['hub']; ?>">Promote Pilot</a></br> <a href="awards.php">Grant Award</a></br> </center> <?php } if($edata['fm'] == 1) {?> <center> <h7><i><b>Fleet Manager Panel</b></i></h7></br> <a href="addaircraft.php">Add Aircraft</a></br> <a href="manageaircraft.php">Manage Aircraft</a> </center> <?php } if($edata['ed'] == 1) {?> <center> <h7><i><b>Events Director Panel</b></i></h7></br> <a href="?page=addevent">Add Event</a></br> <a href="?page=manageevents">Manage Events</a></br> <a href="postnews.php">Post News</a></br> </center> <?php } if($edata['hr'] == 1) { ?> <center> <h7><i><b>Human Rescources Panel</b></i></h7></br> <a href="?page=newpilots">New Pilots</a></br> <a href="?page=editpilots">Edit Pilots</a></br> <a href="viewcomments.php">View Comments</a></br> <a href="viewsitecomments.php">View Site Comments</a></br> <a href="?page=addnews">Post News</a></br> <a href="?page=editnews">Edit News</a></br> <?php } if($edata['bm'] == 1) {?> <center> <h7><i><b>Executive Staff Panel</b></i></h7></br> <a href="edithub.php?hub=<?php echo $edata['hub']; ?>">Edit Hub Page</a></br> <a href="apppireps.php?hub=<?php echo $edata['hub']; ?>">Approve Pireps</a></br> <a href="promote.php?hub=<?php echo $edata['hub']; ?>">Promote Pilot</a></br> <a href="awards.php">Grant Award</a></br> <a href="addevent">Add Event</a></br> <a href="manageevents.php">Manage Events</a></br> <a href="?page=addnews">Post News</a></br> <a href="?page=editnews">Edit News</a></br> <a href="pilotrec.php">Pilot Records</a></br> <a href="?page=newpilots&staffid=<? echo "{$edata["login"]}"?>">New Pilots</a> <font color="#0066FF" size="3" face="Times New Roman, Times, serif"><b><? echo"$enewprow"; ?></font></b></br> <a href="?page=editpilots">Edit Pilots</a></br> <a href="viewcomments.php">View Comments</a></br> <a href="viewsitecomments.php">View Site Comments</a></br> <?php } } }elseif($_SESSION['SESS_LOGGEDIN'] =FALSE){ if(isset($_POST['user'])){ //Include Config File For DB info.. include 'db.php'; //Connect TO The MySQL Server $connect = mysql_connect($db_host,$db_username,$db_password) or die("MySQL Said:".mysql_error()); $database = mysql_select_db($db_database,$connect) or die("MySQl Said:".mysql_error()); $login = mysql_real_escape_string($_POST['user']); $pwd = mysql_real_escape_string($_POST['pwd']); $link = mysql_query("SELECT * FROM `pilots` where login='$login' and pwd='$pwd'") or die("MySQL Said:".mysql_error()); $count = mysql_num_rows($link); $data = mysql_fetch_assoc($link); $lname = $data["lname"]; $hub = $data["hub"]; $pwd = $data["pwd"]; $fname = $data["fname"]; $login= $data["login"]; $status= $data["status"]; $newp = mysql_query("SELECT * FROM `pilots` where status ='0'") or die("MySQL Said:".mysql_error()); $newprow = mysql_num_rows($newp); $result = count($newp); if($count == 1) { if($data['status'] == 0) { echo '<center>Your Account Is Not Active.</center>'; } else { if($data['status'] == 2) { echo '<center><FONT COLOR =ff001b>Your Account Has Been Suspended.</center></FONT COLOR>';?> <center><a href="logout.php">Log Out</a></br></center> <? } else { if($data['status'] == 3) { echo '<center>You Are Currently On L.O.A</center>';?> <a href="rfileloa.php?login=<? echo "{$data["login"]}"?>">Return From L.O.A</a></br><? } else { $_SESSION['SESS_LOGGEDIN'] = TRUE; $_SESSION['SESS_LNAME'] = $lname; $_SESSION['SESS_HUB'] = $hub; $_SESSION['SESS_FNAME'] = $fname; $_SESSION['login'] = $login; $_SESSION['status'] = $status; ?> <body link="#0066FF" vlink="#0066FF" alink="#0066FF"> <center>Welcome Back <? echo"$fname"; ?> <? echo"$lname"; ?></center> <center> <h7><i><b>Pilots Panel</b></i></h7></br> <a href="?page=pirepform&lname=<? echo "{$data["lname"]}"?>">File Pirep</a></br> <a href="?page=fileloa&login=<? echo "{$data["login"]}"?>">File LOA</a></br> <a href="#">Signatures</a></br> <A HREF="?page=profile&login=<? echo "{$data["login"]}"?> ">My Profile</a></br> <a href="?page=editp&login=<? echo "{$data["login"]}"?>">Edit My Profile</a></br> <a href="?page=events">Events</a></br> <a href="?page=rosterphp">VIew Roster</a></br> <a href="#"><font color="#FF0000">Resignation Form</font Color></br> <a href="logout.php">Log Out</a></br> <br> <h7><i><b>Pilots Tools</b></i></h7></br> <a href="http://www.fspassengers.com/"> FS Passengers</a></br> </center> <?php if($data['hm'] == 1) {?> <center> <h7><i><b>Hub Manager Panel</b></i></h7></br> <a href="?page=addnews_hub">Add News</a></br> <a href="?page=edithub">Edit Hub Page</a></br> <a href="apppireps.php?hub=<?php echo $data['hub']; ?>">Approve Pireps</a></br> <a href="promote.php?hub=<?php echo $data['hub']; ?>">Promote Pilot</a></br> <a href="awards.php">Grant Award</a></br> </center> <?php } if($data['fm'] == 1) {?> <center> <h7><i><b>Fleet Manager Panel</b></i></h7></br> <a href="addaircraft.php">Add Aircraft</a></br> <a href="manageaircraft.php">Manage Aircraft</a> </center> <?php } if($data['ed'] == 1) {?> <center> <h7><i><b>Events Director Panel</b></i></h7></br> <a href="?page=addevent">Add Event</a></br> <a href="?page=manageevents">Manage Events</a></br> <a href="postnews.php">Post News</a></br> </center> <?php } if($data['hr'] == 1) { ?> <center> <h7><i><b>Human Rescources Panel</b></i></h7></br> <a href="?page=newpilots">New Pilots</a></br> <a href="?page=editpilots">Edit Pilots</a></br> <a href="viewcomments.php">View Comments</a></br> <a href="viewsitecomments.php">View Site Comments</a></br> <a href="?page=addnews">Post News</a></br> <a href="?page=editnews">Edit News</a></br> <?php } if($data['bm'] == 1) {?> <center> <h7><i><b>Executive Staff Panel</b></i></h7></br> <a href="?page=edithub">Edit Hub Page</a></br> <a href="?page=addnews_hub">Add News For Hubs</a></br> <a href="apppireps.php?hub=<?php echo $data['hub']; ?>">Approve Pireps</a></br> <a href="promote.php?hub=<?php echo $data['hub']; ?>">Promote Pilot</a></br> <a href="awards.php">Grant Award</a></br> <a href="addevent">Add Event</a></br> <a href="manageevents.php">Manage Events</a></br> <a href="?page=addnews">Post News</a></br> <a href="?page=editnews">Edit News</a></br> <a href="pilotrec.php">Pilot Records</a></br> <a href="?page=newpilots&staffid=<? echo "{$data["login"]}"?>">New Pilots</a> <font color="#0066FF" size="3" face="Times New Roman, Times, serif"><b><? echo"$newprow"; ?></font></b></br> <a href="?page=editpilots">Edit Pilots</a></br> <a href="viewcomments.php">View Comments</a></br> <a href="viewsitecomments.php">View Site Comments</a></br> <?php } } } } } } else { echo '<center><FONT COLOR =ff001b> Your <i>Pilot ID And/Or Password</i> is wrong!</center></FONT COLOR>';?> <style type="text/css"> .idBox { width:50px; } .passwordBox { width:80px; } </style> <table border="0" align="center"> <form action="<? $_SERVER['PHP_SELF']; ?>" method="post"> <tr> <td align="center">ID:</td><td align="center">ASA<input type="text" name="user" class="idBox"></td> </tr> <tr> <td align="center">Password:</td><td align="center"><input type="password" name="pwd" class="passwordBox"></td> </tr> <tr> <td></td><td align="center"><p align="center"> <input type="submit" name="login" value="Login"> </p> <p align="center"> <a href="#">Forgot Password</a></p></td> </tr> </table> <? } } ?> Line 13 is: <?php $slogin = $_SESSION['login']; ?> Once again this is the 1st I am receiving this message would be appreciated. Thanks Link to comment https://forums.phpfreaks.com/topic/145847-notice-undefined-index/ Share on other sites More sharing options...
topflight Posted February 19, 2009 Author Share Posted February 19, 2009 I also notice that when I go to another page that message goes away but it says my account is not active. How can it say that if the session is not set. Link to comment https://forums.phpfreaks.com/topic/145847-notice-undefined-index/#findComment-765720 Share on other sites More sharing options...
Philip Posted February 19, 2009 Share Posted February 19, 2009 $slogin = $_SESSION['login']; It means there is no index in the array with the key of login. In otherwords, $_SESSION['login'] doesn't exist. Under session_start(); put: echo '<pre>'; print_r($_SESSION); echo '</pre>'; Link to comment https://forums.phpfreaks.com/topic/145847-notice-undefined-index/#findComment-765723 Share on other sites More sharing options...
topflight Posted February 19, 2009 Author Share Posted February 19, 2009 Now it says: Array ( [sESS_LOGGEDIN] => 1 ) Notice: Undefined index: login in C:\xampp\htdocs\blogin.php on line 14 Link to comment https://forums.phpfreaks.com/topic/145847-notice-undefined-index/#findComment-765726 Share on other sites More sharing options...
Philip Posted February 19, 2009 Share Posted February 19, 2009 So, you only have one session variable set, and that's $_SESSION['SESS_LOGGEDIN'] Link to comment https://forums.phpfreaks.com/topic/145847-notice-undefined-index/#findComment-765730 Share on other sites More sharing options...
topflight Posted February 19, 2009 Author Share Posted February 19, 2009 So how can I fix this problem Link to comment https://forums.phpfreaks.com/topic/145847-notice-undefined-index/#findComment-765736 Share on other sites More sharing options...
Philip Posted February 19, 2009 Share Posted February 19, 2009 You should define the variable. Where do you currently create $_SESSION['login']? Link to comment https://forums.phpfreaks.com/topic/145847-notice-undefined-index/#findComment-765737 Share on other sites More sharing options...
topflight Posted February 19, 2009 Author Share Posted February 19, 2009 I have it set so that it will create the varible when the user inputs their information. Link to comment https://forums.phpfreaks.com/topic/145847-notice-undefined-index/#findComment-765805 Share on other sites More sharing options...
Philip Posted February 19, 2009 Share Posted February 19, 2009 Code? Link to comment https://forums.phpfreaks.com/topic/145847-notice-undefined-index/#findComment-765807 Share on other sites More sharing options...
topflight Posted February 19, 2009 Author Share Posted February 19, 2009 If you look towards the if(isset$_Post[user])... you will see it. <? session_start(); echo '<pre>'; print_r($_SESSION); echo '</pre>'; ?> <? if($_SESSION['SESS_LOGGEDIN'] = TRUE){ include'db.php'; $connect = mysql_connect($db_host,$db_username,$db_password) or die("MySQL Said:".mysql_error()); $database = mysql_select_db($db_database,$connect) or die("MySQl Said:".mysql_error()); $slogin = $_SESSION['login']; $elink = mysql_query("SELECT * FROM `pilots` where login='$slogin'") or die("MySQL Said:".mysql_error()); $edata = mysql_fetch_assoc($elink); $lname = $edata["lname"]; $hub = $edata["hub"]; $pwd = $edata["pwd"]; $fname = $edata["fname"]; $login= $edata["login"]; $status= $edata["status"]; $enewp = mysql_query("SELECT * FROM `pilots` where status ='0'") or die("MySQL Said:".mysql_error()); $enewprow = mysql_num_rows($enewp); $eresult = count($enewp); if($edata['status'] == 0) { echo '<center>Your Account Is Not Active.</center>'; } elseif($edata['status'] == 2) { echo '<center><FONT COLOR =ff001b>Your Account Has Been Suspended.</center></FONT COLOR>';?> <center><a href="logout.php">Log Out</a></br></center> <? } elseif($edata['status'] == 3) { echo '<center>You Are Currently On L.O.A</center>';?> <a href="rfileloa.php?login=<? echo "{$edata["login"]}"?>">Return From L.O.A</a></br><? } else { ?> <body link="#0066FF" vlink="#0066FF" alink="#0066FF"> <center>Welcome Back <? echo"$fname"; ?> <? echo"$lname"; ?></center> <center> <h7><i><b>Pilots Panel</b></i></h7></br> <a href="?page=pirepform&lname=<? echo "{$edata["lname"]}"?>">File Pirep</a></br> <a href="?page=fileloa&login=<? echo "{$edata["login"]}"?>">File LOA</a></br> <a href="#">Signatures</a></br> <A HREF="?page=profile&login=<? echo "{$edata["login"]}"?> ">My Profile</a></br> <a href="?page=editp&login=<? echo "{$edata["login"]}"?>">Edit My Profile</a></br> <a href="?page=events">Events</a></br> <a href="?page=rosterphp">VIew Roster</a></br> <a href="#"><font color="#FF0000">Resignation Form</font Color></br> <a href="logout.php">Log Out</a></br> <br> <h7><i><b>Pilots Tools</b></i></h7></br> <a href="http://www.fspassengers.com/"> FS Passengers</a></br> </center> <?php if($edata['hm'] == 1) {?> <center> <h7><i><b>Hub Manager Panel</b></i></h7></br> <a href="edithub.php?hub=<?php echo $edata['hub']; ?>">Edit Hub Page</a></br> <a href="apppireps.php?hub=<?php echo $edata['hub']; ?>">Approve Pireps</a></br> <a href="promote.php?hub=<?php echo $edata['hub']; ?>">Promote Pilot</a></br> <a href="awards.php">Grant Award</a></br> </center> <?php } if($edata['fm'] == 1) {?> <center> <h7><i><b>Fleet Manager Panel</b></i></h7></br> <a href="addaircraft.php">Add Aircraft</a></br> <a href="manageaircraft.php">Manage Aircraft</a> </center> <?php } if($edata['ed'] == 1) {?> <center> <h7><i><b>Events Director Panel</b></i></h7></br> <a href="?page=addevent">Add Event</a></br> <a href="?page=manageevents">Manage Events</a></br> <a href="postnews.php">Post News</a></br> </center> <?php } if($edata['hr'] == 1) { ?> <center> <h7><i><b>Human Rescources Panel</b></i></h7></br> <a href="?page=newpilots">New Pilots</a></br> <a href="?page=editpilots">Edit Pilots</a></br> <a href="viewcomments.php">View Comments</a></br> <a href="viewsitecomments.php">View Site Comments</a></br> <a href="?page=addnews">Post News</a></br> <a href="?page=editnews">Edit News</a></br> <?php } if($edata['bm'] == 1) {?> <center> <h7><i><b>Executive Staff Panel</b></i></h7></br> <a href="edithub.php?hub=<?php echo $edata['hub']; ?>">Edit Hub Page</a></br> <a href="apppireps.php?hub=<?php echo $edata['hub']; ?>">Approve Pireps</a></br> <a href="promote.php?hub=<?php echo $edata['hub']; ?>">Promote Pilot</a></br> <a href="awards.php">Grant Award</a></br> <a href="addevent">Add Event</a></br> <a href="manageevents.php">Manage Events</a></br> <a href="?page=addnews">Post News</a></br> <a href="?page=editnews">Edit News</a></br> <a href="pilotrec.php">Pilot Records</a></br> <a href="?page=newpilots&staffid=<? echo "{$edata["login"]}"?>">New Pilots</a> <font color="#0066FF" size="3" face="Times New Roman, Times, serif"><b><? echo"$enewprow"; ?></font></b></br> <a href="?page=editpilots">Edit Pilots</a></br> <a href="viewcomments.php">View Comments</a></br> <a href="viewsitecomments.php">View Site Comments</a></br> <?php } } }elseif($_SESSION['SESS_LOGGEDIN'] =FALSE){ if(isset($_POST['user'])){ //Include Config File For DB info.. include 'db.php'; //Connect TO The MySQL Server $connect = mysql_connect($db_host,$db_username,$db_password) or die("MySQL Said:".mysql_error()); $database = mysql_select_db($db_database,$connect) or die("MySQl Said:".mysql_error()); $login = mysql_real_escape_string($_POST['user']); $pwd = mysql_real_escape_string($_POST['pwd']); $link = mysql_query("SELECT * FROM `pilots` where login='$login' and pwd='$pwd'") or die("MySQL Said:".mysql_error()); $count = mysql_num_rows($link); $data = mysql_fetch_assoc($link); $lname = $data["lname"]; $hub = $data["hub"]; $pwd = $data["pwd"]; $fname = $data["fname"]; $login= $data["login"]; $status= $data["status"]; $newp = mysql_query("SELECT * FROM `pilots` where status ='0'") or die("MySQL Said:".mysql_error()); $newprow = mysql_num_rows($newp); $result = count($newp); if($count == 1) { if($data['status'] == 0) { echo '<center>Your Account Is Not Active.</center>'; } else { if($data['status'] == 2) { echo '<center><FONT COLOR =ff001b>Your Account Has Been Suspended.</center></FONT COLOR>';?> <center><a href="logout.php">Log Out</a></br></center> <? } else { if($data['status'] == 3) { echo '<center>You Are Currently On L.O.A</center>';?> <a href="rfileloa.php?login=<? echo "{$data["login"]}"?>">Return From L.O.A</a></br><? } else { $_SESSION['SESS_LOGGEDIN'] = TRUE; $_SESSION['SESS_LNAME'] = $lname; $_SESSION['SESS_HUB'] = $hub; $_SESSION['SESS_FNAME'] = $fname; $_SESSION['login'] = $login; $_SESSION['status'] = $status; ?> <body link="#0066FF" vlink="#0066FF" alink="#0066FF"> <center>Welcome Back <? echo"$fname"; ?> <? echo"$lname"; ?></center> <center> <h7><i><b>Pilots Panel</b></i></h7></br> <a href="?page=pirepform&lname=<? echo "{$data["lname"]}"?>">File Pirep</a></br> <a href="?page=fileloa&login=<? echo "{$data["login"]}"?>">File LOA</a></br> <a href="#">Signatures</a></br> <A HREF="?page=profile&login=<? echo "{$data["login"]}"?> ">My Profile</a></br> <a href="?page=editp&login=<? echo "{$data["login"]}"?>">Edit My Profile</a></br> <a href="?page=events">Events</a></br> <a href="?page=rosterphp">VIew Roster</a></br> <a href="#"><font color="#FF0000">Resignation Form</font Color></br> <a href="logout.php">Log Out</a></br> <br> <h7><i><b>Pilots Tools</b></i></h7></br> <a href="http://www.fspassengers.com/"> FS Passengers</a></br> </center> <?php if($data['hm'] == 1) {?> <center> <h7><i><b>Hub Manager Panel</b></i></h7></br> <a href="?page=addnews_hub">Add News</a></br> <a href="?page=edithub">Edit Hub Page</a></br> <a href="apppireps.php?hub=<?php echo $data['hub']; ?>">Approve Pireps</a></br> <a href="promote.php?hub=<?php echo $data['hub']; ?>">Promote Pilot</a></br> <a href="awards.php">Grant Award</a></br> </center> <?php } if($data['fm'] == 1) {?> <center> <h7><i><b>Fleet Manager Panel</b></i></h7></br> <a href="addaircraft.php">Add Aircraft</a></br> <a href="manageaircraft.php">Manage Aircraft</a> </center> <?php } if($data['ed'] == 1) {?> <center> <h7><i><b>Events Director Panel</b></i></h7></br> <a href="?page=addevent">Add Event</a></br> <a href="?page=manageevents">Manage Events</a></br> <a href="postnews.php">Post News</a></br> </center> <?php } if($data['hr'] == 1) { ?> <center> <h7><i><b>Human Rescources Panel</b></i></h7></br> <a href="?page=newpilots">New Pilots</a></br> <a href="?page=editpilots">Edit Pilots</a></br> <a href="viewcomments.php">View Comments</a></br> <a href="viewsitecomments.php">View Site Comments</a></br> <a href="?page=addnews">Post News</a></br> <a href="?page=editnews">Edit News</a></br> <?php } if($data['bm'] == 1) {?> <center> <h7><i><b>Executive Staff Panel</b></i></h7></br> <a href="?page=edithub">Edit Hub Page</a></br> <a href="?page=addnews_hub">Add News For Hubs</a></br> <a href="apppireps.php?hub=<?php echo $data['hub']; ?>">Approve Pireps</a></br> <a href="promote.php?hub=<?php echo $data['hub']; ?>">Promote Pilot</a></br> <a href="awards.php">Grant Award</a></br> <a href="addevent">Add Event</a></br> <a href="manageevents.php">Manage Events</a></br> <a href="?page=addnews">Post News</a></br> <a href="?page=editnews">Edit News</a></br> <a href="pilotrec.php">Pilot Records</a></br> <a href="?page=newpilots&staffid=<? echo "{$data["login"]}"?>">New Pilots</a> <font color="#0066FF" size="3" face="Times New Roman, Times, serif"><b><? echo"$newprow"; ?></font></b></br> <a href="?page=editpilots">Edit Pilots</a></br> <a href="viewcomments.php">View Comments</a></br> <a href="viewsitecomments.php">View Site Comments</a></br> <?php } } } } } } else { echo '<center><FONT COLOR =ff001b> Your <i>Pilot ID And/Or Password</i> is wrong!</center></FONT COLOR>';?> <style type="text/css"> .idBox { width:50px; } .passwordBox { width:80px; } </style> <table border="0" align="center"> <form action="<? $_SERVER['PHP_SELF']; ?>" method="post"> <tr> <td align="center">ID:</td><td align="center">ASA<input type="text" name="user" class="idBox"></td> </tr> <tr> <td align="center">Password:</td><td align="center"><input type="password" name="pwd" class="passwordBox"></td> </tr> <tr> <td></td><td align="center"><p align="center"> <input type="submit" name="login" value="Login"> </p> <p align="center"> <a href="#">Forgot Password</a></p></td> </tr> </table> <? } } ?> Link to comment https://forums.phpfreaks.com/topic/145847-notice-undefined-index/#findComment-765866 Share on other sites More sharing options...
Philip Posted February 19, 2009 Share Posted February 19, 2009 Find: $_SESSION['SESS_LOGGEDIN'] = TRUE; $_SESSION['SESS_LNAME'] = $lname; $_SESSION['SESS_HUB'] = $hub; $_SESSION['SESS_FNAME'] = $fname; $_SESSION['login'] = $login; $_SESSION['status'] = $status; Add above: echo $login; Link to comment https://forums.phpfreaks.com/topic/145847-notice-undefined-index/#findComment-765869 Share on other sites More sharing options...
topflight Posted February 19, 2009 Author Share Posted February 19, 2009 now it says Array ( [sESS_LOGGEDIN] => 1 ) Notice: Undefined index: login in C:\xampp\htdocs\blogin.php on line 14 also it isn't showing the form to login because i think i unset the session so it show the forum to log in. Link to comment https://forums.phpfreaks.com/topic/145847-notice-undefined-index/#findComment-765870 Share on other sites More sharing options...
topflight Posted February 19, 2009 Author Share Posted February 19, 2009 anything else I can do? when I leave the index page it goes away. Link to comment https://forums.phpfreaks.com/topic/145847-notice-undefined-index/#findComment-766188 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.