sclaren
Posts: 4
|
Posted: 01/27/2004, 5:23 AM |
|
Hello
i have one simple problem (CodeCharge Studio 1.0x).
There are some Session-vars after login and i want print them out, like some Hello <UserName> in the Header. I found workaround in this Forum, that means how to get only Data from a grid, that the current user has created.
But is this really the way to get a Session-Var, only to print out? I tryed to create a label with the Name of the Session-Var but that doesnt work ;o)
So, how can i print the Session-Data without a grid?
Thank you for helping :o)
Sascha
|
|
|
DonB
|
Posted: 01/27/2004, 5:33 AM |
|
Add a Before Show event to the label, then put in some code to assign a
value to it:
Label1->Value = CCGetSession("sessionvariablename");
The username should be obtained with the CCS function provided for that
purpose:
Label1->Value = CCGetUserLogin();
--
DonB
http://www.gotodon.com/ccbth
"sclaren" <sclaren@forum.codecharge> wrote in message
news:54016666ecead1@news.codecharge.com...
> Hello
>
> i have one simple problem (CodeCharge Studio 1.0x).
>
> There are some Session-vars after login and i want print them out, like
some Hello <UserName> in the Header. I found workaround in this Forum, that
means how to get only Data from a grid, that the current user has created.
>
> But is this really the way to get a Session-Var, only to print out? I
tryed to create a label with the Name of the Session-Var but that doesnt
work ;o)
>
> So, how can i print the Session-Data without a grid?
>
> Thank you for helping :o)
>
> Sascha
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
sclaren
Posts: 4
|
Posted: 01/27/2004, 6:11 AM |
|
I think i made something wrong:
i created a new label with the Name label 1 and added a custom code for the before show event like this:
<?php
// //Events @1-F81417CB
function Header_Label1_BeforeShow() { //Header_Label1_BeforeShow @4-719E9279
//Custom Code @5-2A29BDB7
// -------------------------
Label1->Value=CCGetSession("UserLogin");
// -------------------------
//End Custom Code
} //Close Header_Label1_BeforeShow @4-FCB6E20C
?>
But now i get an Parser error on this the line, where i had insert the code.
What is wrong?
Thank u!!!
|
|
|
Don Safar
|
Posted: 01/27/2004, 6:44 AM |
|
In php use
Label1->SetValue=CCGetSession("UserLogin");
"sclaren" <sclaren@forum.codecharge> wrote in message
news:5401671abef4ab@news.codecharge.com...
> I think i made something wrong:
>
> i created a new label with the Name label 1 and added a custom code for
the before show event like this:
>
>
> <?php
> // //Events @1-F81417CB
>
> function Header_Label1_BeforeShow() { //Header_Label1_BeforeShow
@4-719E9279
>
> //Custom Code @5-2A29BDB7
> // -------------------------
> Label1->Value=CCGetSession("UserLogin");
> // -------------------------
> //End Custom Code
>
> } //Close Header_Label1_BeforeShow @4-FCB6E20C
>
> ?>
>
>
> But now i get an Parser error on this the line, where i had insert the
code.
>
> What is wrong?
>
> Thank u!!!
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
uyk
|
Posted: 01/27/2004, 6:45 AM |
|
try this.
Label1->SetValue("CCGetSession('UserLogin')");
|
|
|
sclaren
Posts: 4
|
Posted: 01/27/2004, 7:07 AM |
|
still parser error
It works, if i enter CCGet..... into the Default-Entry for the Label. But i still would know, how it works this the object label1->....
Any idea?
Remeber: i user version 1.07, perhaps there are some differences between this an version 2.x ??
|
|
|
lvalverdeb
Posts: 299
|
Posted: 01/27/2004, 7:43 AM |
|
Try this (with double quotes for var UserLogin only):
Label1->SetValue(CCGetSession("UserLogin"));
_________________
lvalverdeb
CR, GMT-6
XAMPP/Ubuntu/CCS3.2/4 |
|
|
sclaren
Posts: 4
|
Posted: 01/28/2004, 12:18 AM |
|
ok, i will try this later. Thank you for the hints.
i will post if it works
Sashca
|
|
|
Don Safar
|
Posted: 01/28/2004, 12:50 PM |
|
should be
$Label1->SetValue=CCGetSession("UserLogin");
"Don Safar" <donsafar_remove_@hotmail.com> wrote in message
news:bv5tfv$4hc$1@news.codecharge.com...
> In php use
> Label1->SetValue=CCGetSession("UserLogin");
>
> "sclaren" <sclaren@forum.codecharge> wrote in message
>news:5401671abef4ab@news.codecharge.com...
> > I think i made something wrong:
> >
> > i created a new label with the Name label 1 and added a custom code for
> the before show event like this:
> >
> >
> > <?php
> > // //Events @1-F81417CB
> >
> > function Header_Label1_BeforeShow() { //Header_Label1_BeforeShow
> @4-719E9279
> >
> > //Custom Code @5-2A29BDB7
> > // -------------------------
> > Label1->Value=CCGetSession("UserLogin");
> > // -------------------------
> > //End Custom Code
> >
> > } //Close Header_Label1_BeforeShow @4-FCB6E20C
> >
> > ?>
> >
> >
> > But now i get an Parser error on this the line, where i had insert the
> code.
> >
> > What is wrong?
> >
> > Thank u!!!
> >
> > ---------------------------------------
> > Sent from YesSoftware forum
> > http://forums.codecharge.com/
> >
>
>
|
|
|
DonB
|
Posted: 01/28/2004, 4:03 PM |
|
Are you sure it's not:
$Label1->SetValue(CCGetSession("UserLogin"));
(speaking as a casual PHP coder, I live in the ASP world mostly)
--
DonB
http://www.gotodon.com/ccbth
"Don Safar" <dsafar_removethis_@hotmail.com> wrote in message
news:bv97bi$5ct$1@news.codecharge.com...
> should be
> $Label1->SetValue=CCGetSession("UserLogin");
>
> "Don Safar" <donsafar_remove_@hotmail.com> wrote in message
>news:bv5tfv$4hc$1@news.codecharge.com...
> > In php use
> > Label1->SetValue=CCGetSession("UserLogin");
> >
> > "sclaren" <sclaren@forum.codecharge> wrote in message
> >news:5401671abef4ab@news.codecharge.com...
> > > I think i made something wrong:
> > >
> > > i created a new label with the Name label 1 and added a custom code
for
> > the before show event like this:
> > >
> > >
> > > <?php
> > > // //Events @1-F81417CB
> > >
> > > function Header_Label1_BeforeShow() { //Header_Label1_BeforeShow
> > @4-719E9279
> > >
> > > //Custom Code @5-2A29BDB7
> > > // -------------------------
> > > Label1->Value=CCGetSession("UserLogin");
> > > // -------------------------
> > > //End Custom Code
> > >
> > > } //Close Header_Label1_BeforeShow @4-FCB6E20C
> > >
> > > ?>
> > >
> > >
> > > But now i get an Parser error on this the line, where i had insert the
> > code.
> > >
> > > What is wrong?
> > >
> > > Thank u!!!
> > >
> > > ---------------------------------------
> > > Sent from YesSoftware forum
> > > http://forums.codecharge.com/
> > >
> >
> >
>
>
|
|
|
Don Safar
|
Posted: 01/28/2004, 8:16 PM |
|
Once again you are correct.
"DonB" <~ccbth~@gotodon.com> wrote in message
news:bv9ikc$3s2$1@news.codecharge.com...
> Are you sure it's not:
>
> $Label1->SetValue(CCGetSession("UserLogin"));
>
> (speaking as a casual PHP coder, I live in the ASP world mostly)
>
>
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>
> "Don Safar" <dsafar_removethis_@hotmail.com> wrote in message
>news:bv97bi$5ct$1@news.codecharge.com...
> > should be
> > $Label1->SetValue=CCGetSession("UserLogin");
> >
> > "Don Safar" <donsafar_remove_@hotmail.com> wrote in message
> >news:bv5tfv$4hc$1@news.codecharge.com...
> > > In php use
> > > Label1->SetValue=CCGetSession("UserLogin");
> > >
> > > "sclaren" <sclaren@forum.codecharge> wrote in message
> > >news:5401671abef4ab@news.codecharge.com...
> > > > I think i made something wrong:
> > > >
> > > > i created a new label with the Name label 1 and added a custom code
> for
> > > the before show event like this:
> > > >
> > > >
> > > > <?php
> > > > // //Events @1-F81417CB
> > > >
> > > > function Header_Label1_BeforeShow() { //Header_Label1_BeforeShow
> > > @4-719E9279
> > > >
> > > > //Custom Code @5-2A29BDB7
> > > > // -------------------------
> > > > Label1->Value=CCGetSession("UserLogin");
> > > > // -------------------------
> > > > //End Custom Code
> > > >
> > > > } //Close Header_Label1_BeforeShow @4-FCB6E20C
> > > >
> > > > ?>
> > > >
> > > >
> > > > But now i get an Parser error on this the line, where i had insert
the
> > > code.
> > > >
> > > > What is wrong?
> > > >
> > > > Thank u!!!
> > > >
> > > > ---------------------------------------
> > > > Sent from YesSoftware forum
> > > > http://forums.codecharge.com/
> > > >
> > >
> > >
> >
> >
>
>
|
|
|