CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Turning Params into Sessions

Print topic Send  topic

Author Message
Doug
Posted: 01/04/2002, 10:09 AM

I'm open to ideas, but this is what I got. Ite seems sessions are better for navigating around a site. But when you use a CC link and pass a Paramater I have to convert it on the next page. So I have some code on the Before show or Open event of the form (I tried the open event for the page, it wipes out my header):

session("MyAccountID") = getparam("pMyAccountID")

the parameter is created on the URL of the first page. I'm running into several problems. Mostly, the code only works if I "refresh" the page. I guess cause the Session is not set till after the page is loaded.

Any help or experience would help and I'm sure thers may be looking fo this.

-Doug
Brent
Posted: 01/05/2002, 11:47 PM

Doug,
A big problem with session variables is there is only 1 instance of them
for all of your open web pages. The user could have 2 or more browser pages
open (by pressing Ctrl-N) to your site and they all use the same session variable.
This works fine for $UserRights since you want that to be global, but it won't
work well for parameters because the last page displayed will overwrite the
settings for all the other open pages.

The normal way around this is to pass the values as parameters and reference them
in the Before Show event. HTML pages, as you are probably aware, are static
so they are pretty much brain dead.:) It sort of reminds me of the movie
Memento where the actor forgets eveything after 30 seconds and needs to
write everything down. This is the only way for HTML forms to be independent of
each other.

You have to use parameters to get it to retrieve and pass values from and to
other forms. If you need to do a lot of conversions, write a function and put
it in the Modules | Global Functions event. That should help some. But I'm
afraid parameters are a way of life.

BTW, I don't know what language you're using, but in PHP it is
set_session("MyAccountId", get_param("pMyAccountID"));

The session variables are really stored in a global array.
See common.php for more information on the CC functions.
Doug
Posted: 01/08/2002, 7:26 AM

Thanks for the help. With the help of the CC support staff the final conclusion is that a Param can be turned into a session any time in the Open event of the page. It's very helpful if you need the original Param on other pages that don't get the original Param "passed" to it.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.