Damian
|
| Posted: 07/17/2004, 2:57 AM |
|
I want to have a LogIn/LogOut button on my website.
I want to have a button that shows LogIn when you arent (doh!) and when you
are Logged in it will show LogOut.
I am thinking that using CCGetUserID or CCGetSession might be the way to
go...
I have seen the posts in
http://forums.codecharge.com/posts.php?post_id=24842
But I want to do something slightly different... ie shows one button if no
one is logged in, and another if someone is. Am I repeating myself?
|
|
|
 |
Damian
|
| Posted: 07/17/2004, 7:07 AM |
|
I got it.
Worked my way thru the post id below but used the CCGetSession (this is how
Im detecting which user is logged in, so I stuck with it)...
For those that are interested I used the following syntax.
Where top is my page (or include page) name and loghead is the label on the
top page. Add Custom Code to the After Initialise on the label.
//Custom Code @8-CD63D2B9
// -------------------------
global $top;
// Write your own code here.
$loghead = CCGetSession(UserLogin);
if ($loghead !== "")
{
$top->loghead->SetValue("<a href=logout.php>LogOut</a>");
}
else if ($loghead == "")
{
$top->loghead->SetValue("<a href=login.php>LogIn</a>");
}
// -------------------------
//End Custom Code
Point worth noting. When I create a Logout page using the wizard the logout
function doesnt actually work for me. It is doing the Logout Action on
Initialise. I changed it to Before Show and it works.
Damian
PS: Still love some help on my registration form!
"Damian" <codecharge@sydneyit.no.com.junk> wrote in message
news:cdat5m$tt9$1@news.codecharge.com...
> I want to have a LogIn/LogOut button on my website.
>
> I want to have a button that shows LogIn when you arent (doh!) and when
you
> are Logged in it will show LogOut.
>
> I am thinking that using CCGetUserID or CCGetSession might be the way to
> go...
>
> I have seen the posts in
>
> http://forums.codecharge.com/posts.php?post_id=24842
>
> But I want to do something slightly different... ie shows one button if no
> one is logged in, and another if someone is. Am I repeating myself?
>
>
>
|
|
|
 |
jim7567g
Posts: 38
|
| Posted: 12/25/2004, 11:13 AM |
|
Nice, thanks for posting this.
_________________
Jim |
 |
 |
|