![]() Topic awaiting preservation: Problems with session (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: New Jersey, USA |
![]() I am working on a little site and am trying to use PHP's session to pass back errors as well as the data entered, but am running into problems. It seems that I can set a session value using |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
![]() Rhino: Welcome. You have bits of your code there so I'm not sure where the problem is sneaking in but have you started the session? It may be that your Windows server is set to automaticall start sessions while your web server isn't. Anyway there are problem a few places were problems can sneak in - have a look through TP's guide: |
Paranoid (IV) Inmate From: Sthlm, Sweden |
![]() The first you should check is if you have this line |
Bipolar (III) Inmate From: New Jersey, USA |
![]() Sorry I didn't include more code.. Here is an example where I am allowing the person to edit an entry. I am loading up an array called $portfolio and setting it to Session (atleast I think). |
Paranoid (IV) Inmate From: Sthlm, Sweden |
![]() One of the easiest ways to see what content you have and how it is structured in the session is to drop this in the head of the page: code: print("Session:<pre>");
|
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
![]() Rhino: Yep - follow DmS' advice - that is one of the most useful tricks I've found yet. It makes trouble shooting tricky things like arrays much simpler (thanks again for sharing |
Paranoid (IV) Inmate From: Den Haag, Netherlands |
![]() from http://www.php.net ... quote: |
Bipolar (III) Inmate From: New Jersey, USA |
![]() I ended up taking trib's suggestion and giving it a try since I was able to store the ID in session. So, I removed everything from the array and am storing only Simple scalar values into Session. AND IT WORKED! Yahoo. |
Paranoid (IV) Inmate From: Sthlm, Sweden |
![]() Well, I'd have to disagree on that one (no arrays in the session) |
Bipolar (III) Inmate From: New Jersey, USA |
![]() What type of platform are you running this on? I had complete success storing arrays in Session when developing on a Windows platform, but when I finally deployed it onto a Linux server it no longer maintained the arrays and alot of functionality disappeared. So, I am back to the Name/Values in Session. Can you include more code snippets so we can see how you are doing it and please let us know what the platform you are running this on. |
Paranoid (IV) Inmate From: Sthlm, Sweden |
![]() We are developing on win2k or XP with phpdev as a basic developing platform (slightly modded to fit the clients platform) running Apache 1.3.27 PHP 4.2.1 and MySQL 3.23.34 code: function getRegions()
|
Paranoid (IV) Inmate From: Den Haag, Netherlands |
![]() Thanks DMS - interesting information. I've stored it in my "Things Trib should know" braincells ... |