anybody99 Posted April 29, 2007 Share Posted April 29, 2007 When trying to view: http://mhu27900.1111mb.com/member.php it says: Undefined index: uid & pwd Where would be the cause of the problem? <? $uid = $_SESSION['uid']; $pwd = $_SESSION['pwd']; require('main.php'); db_connect(); include(INC_DIR."header.php"); if ($uid){ echo "<br> - Already logged in, <a href='member.php'>continue</a> ( or be redirected ) "; } else { echo "<br><Span Class=emph>Members Log In</SPAN>"; include(INC_DIR."login.php"); } include(INC_DIR."footer.php"); db_disconnect(); ?> Link to comment https://forums.phpfreaks.com/topic/49200-undefined-index-error/ Share on other sites More sharing options...
per1os Posted April 29, 2007 Share Posted April 29, 2007 $uid = isset($_SESSION['uid'])?$_SESSION['uid']:""; $pwd = isset($_SESSION['pwd'])?$_SESSION['pwd']:""; Will fix the problem. Link to comment https://forums.phpfreaks.com/topic/49200-undefined-index-error/#findComment-241075 Share on other sites More sharing options...
anybody99 Posted April 29, 2007 Author Share Posted April 29, 2007 tnx but this one too, says line 117 118 $_SESSION['uid'] = $_REQUEST['uid']; $_SESSION['pwd'] = $_REQUEST['pwd']; <? require('main.php'); if (!isset($_SESSION['uid'])) { $_SESSION['uid'] = $_REQUEST['uid']; $_SESSION['pwd'] = $_REQUEST['pwd']; } $uid = $_SESSION['uid']; $pwd = $_SESSION['pwd']; db_connect(); Link to comment https://forums.phpfreaks.com/topic/49200-undefined-index-error/#findComment-241129 Share on other sites More sharing options...
per1os Posted April 29, 2007 Share Posted April 29, 2007 <?php require('main.php'); if (!isset($_SESSION['uid'])) { $_SESSION['uid'] = isset($_REQUEST['uid'])?$_REQUEST['uid']:""; $_SESSION['pwd'] = isset($_REQUEST['pwd'])?$_REQUEST['pwd']:""; } $uid = $_SESSION['uid']; $pwd = $_SESSION['pwd']; db_connect(); Link to comment https://forums.phpfreaks.com/topic/49200-undefined-index-error/#findComment-241133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.