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 -> GotoCode Archive

 Hide login form in PHP?

Print topic Send  topic

Author Message
kburnett
Posted: 07/16/2003, 9:09 AM

I want to hide the login form once the use is logged in.

I would *think* all i need to do is in the page BeforeShow event place this code:

global $Login;
if(CCGetUserID())
{
$Login->Visible = false;
}

But I can't seem to make it work this way or any other I have tried.

Help?
kburnett
Posted: 07/16/2003, 3:54 PM

in fact i can tell you that the following code works for any record form except the login form:

global $form_name;
$form_name->Visible = false;

?
glerma
Posted: 07/16/2003, 3:57 PM

I think the problem may be in your IF statement.

CCGetUserID() will not return TRUE, which is what I think you are testing for.

It will return the actual UserID value, such as 1,2,3, etc.


I think if you try
/********
If you want to test based on a specific user ID
********/
if (CCGetUserID() != "")

another example:

/********
If you want to test based on the Session Variable being set.
********/
if (session_is_registered('UserID')



Hope that helps a bit.

george
glerma
Posted: 07/16/2003, 4:03 PM

Oops, my bad. First example is wrong.


/***
Corrected
***/
if (CCGetUserID() == "1")
kburnett
Posted: 07/16/2003, 5:08 PM

well, as it turns out my problem was not that i could not hide the login form. the problem was that my login form was on an includable page and so i could not hide with $Login->Visible. i just pulled the form out and put in straight onto my main page and all is well.

including pages can really mess ya up.

   


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.