Jump to content

hide login afer loggd in


LethaLdaku

Recommended Posts

[!--quoteo(post=356045:date=Mar 17 2006, 05:55 PM:name=lethal daku)--][div class=\'quotetop\']QUOTE(lethal daku @ Mar 17 2006, 05:55 PM) [snapback]356045[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hi basicaly im unsure how to doit but on my site [a href=\"http://www.myprofilepic.com\" target=\"_blank\"]http://www.myprofilepic.com[/a]
it has login box on the main page and when u sign in it still shows the login box
i was wondering how i would hide the login box for logged in users
[/quote]


by using an if statement -

set $logged in to the username of user ( im not sure how your setting username so il leave this to you )

if ($loggedin) { //if the user is logged in

echo ""; // display nothing

}

else { // if rhe user is not logged in and $loggedin is not set

echo "<form> form code etc"; // display the form

}

  • 5 weeks later...
[!--quoteo(post=356186:date=Mar 18 2006, 05:37 PM:name=TEENFRONT)--][div class=\'quotetop\']QUOTE(TEENFRONT @ Mar 18 2006, 05:37 PM) [snapback]356186[/snapback][/div][div class=\'quotemain\'][!--quotec--]
by using an if statement -

set $logged in to the username of user ( im not sure how your setting username so il leave this to you )

if ($loggedin) { //if the user is logged in

echo ""; // display nothing

}

else { // if rhe user is not logged in and $loggedin is not set

echo "<form> form code etc"; // display the form

}
[/quote]

Hi, i've just tried this out, I can get it to determine if a user is logged in or not, using the fact that a username is logged in on the session... where i'm having trouble is getting it to display the form...

at this point:

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]

else { // if rhe user is not logged in and $loggedin is not set

echo "<form> form code etc"; // display the form

}
[/quote]

I can't seem to get it to display the form instead, i always get this error:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\Program Files\xampp\htdocs\loginTest\normal.php on line 60

any help, i'm very new to PHP, just need to get this little bit working! How do i need to put the form code into the echo statement [b]exactly[/b] to get it to display the form!! Any help would be much appreciated. thnx!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.