CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 How to create session varaiables ?

Print topic Send  topic

Author Message
Thierry B.
Posted: 05/27/2001, 9:13 PM

Hello,

I have a list of items but each user can only view some of them. As there
is a USER field in my "Item" table, I use the "UserID" session created in
the login page to display only items allowed to each user. In the master
page form property, imput tab, I choosed to display only records with
user field matching Session("UserID"). It works.

I use CC page wizard to navigate in the detailed pages where the "User"
table is not used. It works fine except the fact that the subitems ID are
visible in the URL. This mean that only the master page is protected.
After a user logged in and browse to detailed page, he only had to change
"...?subItemID=5" to "...?subItemID=any number" in the URL to view all
the database.

So I decided to use session variables instead, in all forms/input tabs.
But I did not found a way to create session variable in CC. I expected to
see it in the output tab of field property, but we can create only
standard variables.

Do we have to manually code this in events tab ?


--

Thierry B.
thierry.bo@NOSPAMnetcourrier.com
---------------------------------------------------------------------
Email/Mél :REMOVE/ENLEVER "NOSPAM" from Email to answer/de l'Email pour
me répondre
---------------------------------------------------------------------
Hellen
Posted: 05/28/2001, 1:09 AM

Thierry,
usage of session variables depends on language. Set session variables in one
of the events when the variable value is already defined. You can use
session variable as input parameter for form or get its value in other
events.
ASP:
Session("CID") = CID
fldCompanyID = Session("CID")
PHP:
set_session ("ComID", $CID);
$fldCompanyID = get_session("ComID");
Perl:
SetSessionVar("CID", $CID);
$fldCompanyID = GetSessionVar("CID") ;
JSP:
session.setAttribute("CID", CID);
fldCompanyID = session.getAttribute("CID");

Regards,
CodeCharge Support

"Thierry B." <thierry.bo@NOSPAMnetcourrier.com> wrote in message
news:MPG.157ba768b7251f07989681@news.codecharge.com...
> Hello,
>
> I have a list of items but each user can only view some of them. As there
> is a USER field in my "Item" table, I use the "UserID" session created in
> the login page to display only items allowed to each user. In the master
> page form property, imput tab, I choosed to display only records with
> user field matching Session("UserID"). It works.
>
> I use CC page wizard to navigate in the detailed pages where the "User"
> table is not used. It works fine except the fact that the subitems ID are
> visible in the URL. This mean that only the master page is protected.
> After a user logged in and browse to detailed page, he only had to change
> "...?subItemID=5" to "...?subItemID=any number" in the URL to view all
> the database.
>
> So I decided to use session variables instead, in all forms/input tabs.
> But I did not found a way to create session variable in CC. I expected to
> see it in the output tab of field property, but we can create only
> standard variables.
>
> Do we have to manually code this in events tab ?
>
>
> --
>
> Thierry B.
>thierry.bo@NOSPAMnetcourrier.com
> ---------------------------------------------------------------------
> Email/Mél :REMOVE/ENLEVER "NOSPAM" from Email to answer/de l'Email pour
> me répondre
> ---------------------------------------------------------------------

Malik
Posted: 05/28/2001, 4:31 AM

Hi Thierry,

You talked just voice of my heart. I have similar problem. I did read the
reply from CC but could not get it that whether I have to put this code in
each ASP page or has to put in event of main entry page?

I using ASP and wonder if you can send me a smaple example in CC profile?

Malik


"Thierry B." <thierry.bo@NOSPAMnetcourrier.com> wrote in message
news:MPG.157ba768b7251f07989681@news.codecharge.com...
> Hello,
>
> I have a list of items but each user can only view some of them. As there
> is a USER field in my "Item" table, I use the "UserID" session created in
> the login page to display only items allowed to each user. In the master
> page form property, imput tab, I choosed to display only records with
> user field matching Session("UserID"). It works.
>
> I use CC page wizard to navigate in the detailed pages where the "User"
> table is not used. It works fine except the fact that the subitems ID are
> visible in the URL. This mean that only the master page is protected.
> After a user logged in and browse to detailed page, he only had to change
> "...?subItemID=5" to "...?subItemID=any number" in the URL to view all
> the database.
>
> So I decided to use session variables instead, in all forms/input tabs.
> But I did not found a way to create session variable in CC. I expected to
> see it in the output tab of field property, but we can create only
> standard variables.
>
> Do we have to manually code this in events tab ?
>
>
> --
>
> Thierry B.
>thierry.bo@NOSPAMnetcourrier.com
> ---------------------------------------------------------------------
> Email/Mél :REMOVE/ENLEVER "NOSPAM" from Email to answer/de l'Email pour
> me répondre
> ---------------------------------------------------------------------

Hellen
Posted: 05/28/2001, 7:04 AM

Let's imagine we have three tables:
1. Security_table:
user_id
login
password
2. Master_table
use_id
item_id
etc.
3. Detail_table
item_id
etc.
Master_table Grid form gets session variable UserID as input parameter. It
passes item_id as URL parameter to Detail_table Record/Grid form, but to
filter showing records in Detail_table UserID is need. Detail_table hasn't
user_id field and we can't use UserID to filter records.
To solve this problem 'Open' event for Detail_table all Grid/Record forms is
need:
PHP
$exist = dLookUp("Master_table", "user_id", "user_id
=".get_session("UserID")." and item_id = ".get_param("item_id"));
if !($exist)
{
header("Location: Master_tableGridPage.php");
}

ASP
exist = dLookUp("Master_table", "user_id", "user_id =" &
GetSession("UserID") & " and item_id= " & GetParam("item_id"))
if exist = "" then
response.redirect "Master_tableGridPage.asp"
end if

"Malik" <n.malik@usa.net> wrote in message
news:9etcv2$63h$1@mail.tankhill.com...
> Hi Thierry,
>
> You talked just voice of my heart. I have similar problem. I did read the
> reply from CC but could not get it that whether I have to put this code in
> each ASP page or has to put in event of main entry page?
>
> I using ASP and wonder if you can send me a smaple example in CC profile?
>
> Malik
>
>
> "Thierry B." <thierry.bo@NOSPAMnetcourrier.com> wrote in message
>news:MPG.157ba768b7251f07989681@news.codecharge.com...
> > Hello,
> >
> > I have a list of items but each user can only view some of them. As
there
> > is a USER field in my "Item" table, I use the "UserID" session created
in
> > the login page to display only items allowed to each user. In the master
> > page form property, imput tab, I choosed to display only records with
> > user field matching Session("UserID"). It works.
> >
> > I use CC page wizard to navigate in the detailed pages where the "User"
> > table is not used. It works fine except the fact that the subitems ID
are
> > visible in the URL. This mean that only the master page is protected.
> > After a user logged in and browse to detailed page, he only had to
change
> > "...?subItemID=5" to "...?subItemID=any number" in the URL to view all
> > the database.
> >
> > So I decided to use session variables instead, in all forms/input tabs.
> > But I did not found a way to create session variable in CC. I expected
to
> > see it in the output tab of field property, but we can create only
> > standard variables.
> >
> > Do we have to manually code this in events tab ?
> >
> >
> > --
> >
> > Thierry B.
> >thierry.bo@NOSPAMnetcourrier.com
> > ---------------------------------------------------------------------
> > Email/Mél :REMOVE/ENLEVER "NOSPAM" from Email to answer/de l'Email pour
> > me répondre
> > ---------------------------------------------------------------------
>
>


   


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

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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