CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Call to a member function on a non-object

Print topic Send  topic

Author Message
guest
Posted: 05/05/2003, 8:32 AM

This is a multi-part message in MIME format.

------=_NextPart_000_0100_01C312FA.75E7B7F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

I have a grid in my header page (includable file) that has the users table
as the data source. The where clause checks the table user_id against the
Session UserID. When I logout, the application returns to the login page,
but shows the first user in the table as being logged in (instead of
displaying "no records"). This could be a bug. Anyway, I am trying to set
the value in the element in the grid to "Not Logged In" if there is no
Session variable for UserID. Below is the code in the before show event for
the control. it is not working. I am getting this error ->Fatal error: Call
to a member function on a non-object in
D:\Inetpub\wwwroot\testcrm\Header_events.php on line 14
I have also tried using this same code in the form BeforeShow, doesn't work
there either. Anyone see what I am doing wrong?

//Header_users_username_BeforeShow @7-22EEAE5A
function Header_users_username_BeforeShow()
{
$Header_users_username_BeforeShow = true;
//End Header_users_username_BeforeShow

//Custom Code @14-2A29BDB7
// -------------------------
global $users;
if (!CCGetSession("UserID"))
$users->username->SetValue("Not Logged In");
// -------------------------
//End Custom Code

//Close Header_users_username_BeforeShow @7-FE22E5DD
return $Header_users_username_BeforeShow;
}
Don Safar

donsafar@hotmail.com

------=_NextPart_000_0100_01C312FA.75E7B7F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial>I have a grid in my header page (includable =
file) that has=20
the users table as the data source. The where clause checks the table =
user_id=20
against the Session UserID. When I logout, the application returns to =
the login=20
page, but shows the first user in the table as being logged in (instead =
of=20
displaying  "no records"). This could be a bug. Anyway, I am trying =
to set=20
the value in the element in the grid to "Not Logged In" if there is no =
Session=20
variable for UserID. Below is the code in the before show event for the =
control.=20
it is not working. I am getting this error -><FONT=20
face=3D"Times New Roman"><STRONG>Fatal error</STRONG>: Call to a member =
function=20
on a non-object in <B>D:\Inetpub\wwwroot\testcrm\Header_events.php</B> =
on line=20
<B>14</B></FONT><BR>I have also tried using this same code in the form=20
BeforeShow, doesn't work there either. Anyone see what I am doing wrong? =

</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>//Header_users_username_BeforeShow =
@7-22EEAE5A<BR>function=20
Header_users_username_BeforeShow()<BR>{<BR>   =20
$Header_users_username_BeforeShow =3D true;<BR>//End=20
Header_users_username_BeforeShow</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>//Custom Code @14-2A29BDB7<BR>//=20
-------------------------<BR>global $users;<BR>if=20
(!CCGetSession("UserID"))<BR> $users->username->SetValue("Not =
Logged=20
In");</FONT></DIV>
<DIV><FONT face=3DArial>// -------------------------<BR>//End Custom=20
Code</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>//Close Header_users_username_BeforeShow=20
@7-FE22E5DD<BR>    return=20
$Header_users_username_BeforeShow;<BR>}</FONT></DIV>
<DIV>
<DIV class=3DSection1>
<P class=3DMsoNormal><SPAN=20
style=3D"FONT-SIZE: 18pt; FONT-FAMILY: 'Staccato222 BT'">Don =
Safar<?xml:namespace=20
prefix =3D o ns =3D "urn:schemas-microsoft-com:office:office"=20
/><o:p></o:p></SPAN></P>
<P class=3DMsoNormal><A=20
href=3D"mailto:donsafar@hotmail.com">donsafar@hotmail.com</A></P></DIV></=
DIV></BODY></HTML>

------=_NextPart_000_0100_01C312FA.75E7B7F0--
DonB
Posted: 05/05/2003, 10:17 AM

This is a multi-part message in MIME format.

------=_NextPart_000_00C8_01C31309.A48949C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Maybe you have a reason for putting the header on the login page, but =
I'd say remove it. If you need it, then why don't you create a second =
header for the login page (did you know you can have more than one =
header/footer per project?).

It seems the simplest solution is a header that says "not logged in", or =
whatever, and use THAT header on the login page.

The issue with seeing the first user in the table is due to the =
recordset being initialized to the first row of your table, and you have =
the control "bound" to the username field. This is the intended =
(designed) behavior of CCS. =20

It appears that the SQL used to populate the grid does not have a WHERE =
UserID =3D Session("UserID"), since you see a username when "logged =
out". So I'd look at whether the session var is really empty. =
Alternatively, you could try setting it to "-1" or whatever is not a =
valid UserID (instead of setting the session var empty). CCS might be =
dropping the WHERE term if there is no session var (bug? maybe)

DonB
<dontspamme_dsafar@hotmail.com> wrote in message =
news:b9605j$a9s$1@news.codecharge.com...
I have a grid in my header page (includable file) that has the users =
table as the data source. The where clause checks the table user_id =
against the Session UserID. When I logout, the application returns to =
the login page, but shows the first user in the table as being logged in =
(instead of displaying "no records"). This could be a bug. Anyway, I am =
trying to set the value in the element in the grid to "Not Logged In" if =
there is no Session variable for UserID. Below is the code in the before =
show event for the control. it is not working. I am getting this error =
->Fatal error: Call to a member function on a non-object in =
D:\Inetpub\wwwroot\testcrm\Header_events.php on line 14
I have also tried using this same code in the form BeforeShow, doesn't =
work there either. Anyone see what I am doing wrong?=20

//Header_users_username_BeforeShow @7-22EEAE5A
function Header_users_username_BeforeShow()
{
$Header_users_username_BeforeShow =3D true;
//End Header_users_username_BeforeShow

//Custom Code @14-2A29BDB7
// -------------------------
global $users;
if (!CCGetSession("UserID"))
$users->username->SetValue("Not Logged In");
// -------------------------
//End Custom Code

//Close Header_users_username_BeforeShow @7-FE22E5DD
return $Header_users_username_BeforeShow;
}
Don Safar

donsafar@hotmail.com

------=_NextPart_000_00C8_01C31309.A48949C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o =3D "urn:schemas-microsoft-com:office:office"><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1170" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Maybe you have a reason for putting the =
header on=20
the login page, but I'd say remove it.  If you need it, then why =
don't you=20
create a second header for the login page (did you know you can have =
more than=20
one header/footer per project?).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>It seems the simplest solution is a =
header that=20
says "not logged in", or whatever, and use THAT header on the login=20
page.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The issue with seeing the first user in =
the table=20
is due to the recordset being initialized to the first row of your =
table, and=20
you have the control "bound" to the username field.  This is the =
intended=20
(designed) behavior of CCS.   </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>It appears that the SQL used to =
populate the grid=20
does not have a WHERE UserID =3D Session("UserID"), since you see a =
username when=20
"logged out".  So I'd look at whether the session var is really=20
empty.  Alternatively, you could try setting it to "-1" or whatever =
is not=20
a valid UserID (instead of setting the session var empty).  CCS =
might be=20
dropping the WHERE term if there is no session var (bug? =
maybe)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>DonB</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV><<A=20
=
href=3D"mailto:dontspamme_dsafar@hotmail.com">dontspamme_dsafar@hotmail.c=
om</A>>=20
wrote in message <A=20
=
href=3D"news:b9605j$a9s$1@news.codecharge.com">news:b9605j$a9s$1@news.cod=
echarge.com</A>...</DIV>
<DIV><FONT face=3DArial>I have a grid in my header page (includable =
file) that=20
has the users table as the data source. The where clause checks the =
table=20
user_id against the Session UserID. When I logout, the application =
returns to=20
the login page, but shows the first user in the table as being logged =
in=20
(instead of displaying  "no records"). This could be a bug. =
Anyway, I am=20
trying to set the value in the element in the grid to "Not Logged In" =
if there=20
is no Session variable for UserID. Below is the code in the before =
show event=20
for the control. it is not working. I am getting this error -><FONT =

face=3D"Times New Roman"><STRONG>Fatal error</STRONG>: Call to a =
member function=20
on a non-object in <B>D:\Inetpub\wwwroot\testcrm\Header_events.php</B> =
on line=20
<B>14</B></FONT><BR>I have also tried using this same code in the form =

BeforeShow, doesn't work there either. Anyone see what I am doing =
wrong?=20
</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>//Header_users_username_BeforeShow=20
@7-22EEAE5A<BR>function=20
Header_users_username_BeforeShow()<BR>{<BR>   =20
$Header_users_username_BeforeShow =3D true;<BR>//End=20
Header_users_username_BeforeShow</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>//Custom Code @14-2A29BDB7<BR>//=20
-------------------------<BR>global $users;<BR>if=20
=
(!CCGetSession("UserID"))<BR> $users->username->SetValue("Not =

Logged In");</FONT></DIV>
<DIV><FONT face=3DArial>// -------------------------<BR>//End Custom=20
Code</FONT></DIV>
<DIV><FONT face=3DArial></FONT> </DIV>
<DIV><FONT face=3DArial>//Close Header_users_username_BeforeShow=20
@7-FE22E5DD<BR>    return=20
$Header_users_username_BeforeShow;<BR>}</FONT></DIV>
<DIV>
<DIV class=3DSection1>
<P class=3DMsoNormal><SPAN=20
style=3D"FONT-SIZE: 18pt; FONT-FAMILY: 'Staccato222 BT'">Don=20
Safar<o:p></o:p></SPAN></P>
<P class=3DMsoNormal><A=20
=
href=3D"mailto:donsafar@hotmail.com">donsafar@hotmail.com</A></P></DIV></=
DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_00C8_01C31309.A48949C0--

   


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

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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