dpiearcy Posted December 15, 2012 Share Posted December 15, 2012 I appreciate all the help in my last post and that issue has been resolved and working perfectly. Now I'm in need of creating a session because I need the ID passed from one page to the next because I want to add to that row based upon that ID. Here is the first page code: (Someone told me how to insert code here but I forget.) <?php session_start(); $_SESSION['pid']=$_POST['pid']; ?> Also have tried just a plain old $pid="$_POST['pid']; then declaring session as $pid. on the second page I'm using: <?php session_start(); echo $_SESSION['pid']; ?> (just using echo now to see if I'm getting the variable I'm wanting). I get nothing. I'm not passing that ID and I REALLY need it. Help? Quote Link to comment https://forums.phpfreaks.com/topic/272033-php-session-issues/ Share on other sites More sharing options...
dpiearcy Posted December 15, 2012 Author Share Posted December 15, 2012 I have browsed this forum and noticed other threads dealing with sessions but didn't find a solution in any of those either. I thought it could be my browser not accepting cookies (but it does accept the cookie I write for my admin section) so I tested in Chrome, Safari, Firefox, and IE (YUCK!) and am not passing that variable in any of them. Quote Link to comment https://forums.phpfreaks.com/topic/272033-php-session-issues/#findComment-1399564 Share on other sites More sharing options...
dpiearcy Posted December 15, 2012 Author Share Posted December 15, 2012 Never mind. I figured it out. Didn't the whole Homer Simpson "DURH" when I saw my error. Quote Link to comment https://forums.phpfreaks.com/topic/272033-php-session-issues/#findComment-1399567 Share on other sites More sharing options...
DavidAM Posted December 16, 2012 Share Posted December 16, 2012 I have browsed this forum and noticed other threads dealing with sessions but didn't find a solution in any of those either. Never mind. I figured it out. Be nice, and post the problem you found and your solution. Then the next guy (or gal) that searches the forum might find your solution and solve their own problem. Quote Link to comment https://forums.phpfreaks.com/topic/272033-php-session-issues/#findComment-1399723 Share on other sites More sharing options...
dpiearcy Posted December 16, 2012 Author Share Posted December 16, 2012 Be nice, and post the problem you found and your solution. Then the next guy (or gal) that searches the forum might find your solution and solve their own problem. Oops. Sorry about that David. I added a new post about sessions I titled something like just to help others dealing with sessions that detailed the problem I was having. Basically I was redirecting pages with a header change and then oddly I would lose my session variable. When I changed the way I redirected with a print the problem went away and I was able to receive my session variables. Still haven't figured out why I lost them with the header redirect but after I had a solution I moved on from there but it's something I'm going to look into in the future. After this project is finished perhaps. Quote Link to comment https://forums.phpfreaks.com/topic/272033-php-session-issues/#findComment-1399725 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.