I know this is simple, but I am not a php programmer,so cannot figure it out. All i want to do is. when user is not logged in, he should see 'LOGIN' instead of 'SIGNOUT'. I have no idea how to do this. <li style="float: right;"><? if($_COOKIE[$ck_userid]) { ?> <a href="?view=logout&signout=now" rel="nofollow"><?=$lang['SIGNOUT']; ?> </a></li> <? } ?> Code (markup): help will be highly appreciated. Thanks Nirav
If you are using sessions or cookies you can have a conditional statement checking if the session or cookie is set or not.
I wish i could have understood what you said. Thanks for the tip! Can sombody help me on altering this code rather than suggesting what to do, i don't know php. Thanks Nirav
HI, Thanks for the tip! how will this work ? as i want to use LOGIN when user is a guest. and i want LOGIN to change to SIGNOUT after the user has logged in. Thanks Nirav
I think that isset command will do the trick, try the following: <li style="float: right;"><? if(isset($_COOKIE[$ck_userid])) { ?> <a href="?view=logout&signout=now" rel="nofollow"><?=$lang['SIGNOUT']; ?> </a></li> <? } ?> Code (markup): For more on this command try this link to php.net site. Hope that helps really.
hey redbay, thanks for the help! that did not do the trick...I m not sure if i am clear on what am looking for for guest <a href="login.html">login</a> For logged in <? if(isset($_COOKIE[$ck_userid])) { ?> <a href="?view=logout&signout=now" rel="nofollow"><?=$lang['SIGNOUT']; ?> </a> I am unsure on how do i switch between these two. Thanks Nirav
<li style="float: right;"> <? if(isset($_COOKIE[$ck_userid])) { ?> <a href="?view=logout&signout=now" rel="nofollow"><?=$lang['SIGNOUT']; ?> </a></li> <? } else { ?> <a href="?view=login&login=now" rel="nofollow"><?=$lang['LOGIN']; ?> </a></li> <? } ?> PHP: is this what u looking for? I assume that if the $_COOKIE[$ck_userid] is SET, the user is logged in and if it is not, the user is not logged in. Replace the url and $LANG of login as u wish. good luck
what more do I say? You are a STAR ads2help! i really appreciate your help! You have solved my problem!! Thank you so much! Nirav
Try this: <li style="float: right;"><?php if($_COOKIE[$ck_userid]) { echo '<a href="?view=logout&signout=now" rel="nofollow">'.$lang['SIGNOUT']. '</a>'; }else{ echo '<a href="?view=login&signin=now">'. .$lang['SIGNIN']. '</a>'; } ?></li> I don't know the URL which shows when you click login, so you need to edit . href after else. regards
hey jeet! appreciate your help! ads2help solved my problem in the prev post. Thanks u so much!! DP rocks guys! Nirav