| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Registered User
Join Date: Feb 2006
Posts: 30
|
Session with two values
Hi there i know this is a daft question but i have been playing with this block of code and know i am missing something really simple. I have created a two sessions - (tf4) (tf5). I want tf4 to store a value which is simple to do no problems. But if session-tf4 already has a value stored in it then i would like tf5 to capture the value. I have tried to do this with an if statement but both the sessions get populated with exactly the same value each time i run through the application. The code is like this: <% Session("keycode") = Request( "keycode") %> <% Session("tf4") = Request( "keycode") %> <% if Session("tf4") <> "" or Session("tf4") = Session("Keycode") then session("tf5") = session("keycode") Else Session("tf4") = Session("Keycode") end if %> So I will only need session tf5 if tf4 has a value stored in it. Any suggestions on what i could do? Do apologise about the silly question, thanks. |
|
|
|
|
|
#3 (permalink) |
|
Just another web monkey
|
Remember that sessions persist across page refreshes - if you want to test this is working properly, stick: Code:
Try this: Code:
Hope this helps but I get the impression you're trying to do something the wrong way lol |
|
![]() |