Welcome! Log In Create A New Profile

Advanced

Don Schwirtlich: Assigning values to project level variables

Posted by harvey68 
Don Schwirtlich: Assigning values to project level variables
September 08, 2018 05:28PM
Autor: Don Schwirtlich

Link zum Beitrag: [27130.foren.mysnip.de]

I set up a project level variable - gsEmailString. I also assigned it a
value at the project level - then later in a login page, i have the user
enter an email address Edt_Email - and then
in code, i have tried both server and browser code, set the project
level variable equal to the value in Edt_Email as in gsEmailString =
Edt_Email, then i do an Info() - and gsEmailString has the now current
email address. - and then I go to another page - and display the
value of the gsEmailString - and it is reset to the original value.

I assume this is a scope issue - but what do you use to pass a value
from one page to another. I know we can use parameters to pass values
- I want to make use of what is being called project level variables ,
not just for passing an email id along, but results of calculations,
etc. Help ?

Don
Don Schwirtlich: Assigning values to project level variables
September 08, 2018 05:29PM
Autor: Don Schwirtlich

Link zum Beitrag: [27130.foren.mysnip.de]

DeclareAWPContext - rock and roll. Had hoped this was covered in some
as yet unseen pcsoft magic.
Fabrice Harari: Assigning values to project level variables
September 08, 2018 05:30PM
Autor: Fabrice Harari

Link zum Beitrag: [27130.foren.mysnip.de]

Hi Don,

I'm happy you found a solution... But your solution shows another
problem: you currently do not know how to ask questions

More precisely, pb in webdev have a very narrow context... awp, classic
mode, php mode, browser or server code, ajax... LOTS of things will
change the way things work and the answers we can give you... If you do
not give us your context, we cannot answer you...

And another thing that will explain your original problem: an awp page
is a stand alone program. Therefore each time an awp page is started,
the project code will be run (and your global variable will be set with
it's original value)

So yes, declareawpcontext is one solution; but be aware that it relies
on cookies to work, and that any user forbidding cookies will get a non
functional web site.

I prefer to store all my global variables values inside a session record
in my DB and pass MY session ID from one page to the next... No cookies
needed.

Best regards
Don Schwirtlich: Assigning values to project level variables
September 08, 2018 05:32PM
Autor: Don Schwirtlich

Link zum Beitrag: [27130.foren.mysnip.de]

Your approach is the one I am most likely going to use (storing
'global' data in the db - and passing sessionid via parameters, etc) -
and the information you just gave me is very helpful. And according to
what I read,

ConfigureAWPContext(ctxDisk)

does not rely on cookies to work.

And thanks for you for very helpful criticism on my asking questions, i
am amazed that all of you arent able to read my feeble mind and know
what I really need, lol. I will do better, thanks as always Fabrice,
you are a good friend.

Best regards,

Don
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: