Moron Posted April 9, 2008 Share Posted April 9, 2008 This was working before I had to make some query changes. In the query: WHERE M2.[EMPNO] = '".$_POST['empcode']."' and M2.[Last4SSN] = '".$_POST['password']."' They log in with their employee number and last of of the SSN. So far, so good. Then they hit a sub-page. All is well. When they click a link to go back, it doesn't accept their username or password (or both). Each page has the following at the top: session_start(); if(isset($_POST['password'])) {$_SESSION['password'] = $_POST['password'];} if(isset($_POST['empcode'])) {$_SESSION['empcode'] = $_POST['empcode'];} I don't know what's causing this, but it was working until I changed the WHERE statement this morning. Link to comment https://forums.phpfreaks.com/topic/100302-whats-wrong-with-my-sessions/ Share on other sites More sharing options...
uniflare Posted April 9, 2008 Share Posted April 9, 2008 you are using POST variables in the query, use SESSION variables instead. WHERE M2.[EMPNO] = '".$_SESSION['empcode']."' and M2.[Last4SSN] = '".$_SESSION['password']."' Link to comment https://forums.phpfreaks.com/topic/100302-whats-wrong-with-my-sessions/#findComment-512883 Share on other sites More sharing options...
Moron Posted April 9, 2008 Author Share Posted April 9, 2008 Oops. Double post. Link to comment https://forums.phpfreaks.com/topic/100302-whats-wrong-with-my-sessions/#findComment-512939 Share on other sites More sharing options...
Moron Posted April 9, 2008 Author Share Posted April 9, 2008 you are using POST variables in the query, use SESSION variables instead. WHERE M2.[EMPNO] = '".$_SESSION['empcode']."' and M2.[Last4SSN] = '".$_SESSION['password']."' That works. Thanks!!!! Link to comment https://forums.phpfreaks.com/topic/100302-whats-wrong-with-my-sessions/#findComment-513048 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.