bs0d |
Subject: "re: Help with
Login"
Posted: @ 5:31 pm on Oct 22 2008
|
|
|
 Member #: 1 Rank: Admin. - (1,510) Since: 02/06/05 Posts: 604 From: USA
|
When you're
logged in, a
cookie is set
(if you select
'remember
me') and
session
variables are
set, such as:
- $_SESSI
ON['logged_in
']
- $_SESS
ION['username
']
You
use these to
identify the
user, and
display a link
to the logout
page, which is
unset these
variables and
clear the
session.
|
Viewed: 14,080 Times | |  |
wekiller |
Subject: "re: Help with
Login"
Posted: @ 6:12 pm on Oct 22 2008
|
|
|
Member #: 773 Rank: user - (4) Since: 10/22/08 Posts: 4
|
everything
works perfect
now really good
tutorial man
thnx
there is one
more thing... i
want a code
that when im
logged in
<?php
include('heade
r.php');
if($_SESSION['
logged_in'] ==
1)
{
>>>>
;>>>&g
t;> Remove
The Linking to
Login and
Register so
that only
Profile and
Home is
left<<<
;<<<&l
t;<<
?>
how should i do
that ? what is
the code? could
someone help
me.?
Edited at 06:31:01 pm on 10/22/08
|
Viewed: 14,076 Times | |  |
bs0d |
Subject: "re: Help with
Login"
Posted: @ 8:32 pm on Oct 22 2008
|
|
|
 Member #: 1 Rank: Admin. - (1,510) Since: 02/06/05 Posts: 604 From: USA
|
It would be
something like
this: Code:
<?
//check if user
is logged in
if($_SESSION['
logged_in']
==1) {
//display
logout stuff
} else {
//display
sign-in
stuff
} //end if.
?>
Is
that what you
wanted? Just
put the code
within the
condition in
the appropriate
places.
|
Viewed: 14,067 Times | |  |
wekiller |
Subject: "re: Help with
Login"
Posted: @ 8:42 pm on Oct 22 2008
|
|
|
Member #: 773 Rank: user - (4) Since: 10/22/08 Posts: 4
|
no i mean
like
<?php
include('heade
r.php');
if($_SESSION['
logged_in'] ==
1)
{
visable="
false"<
;<a
href="log
in.php"&g
t;Login</a&g
t;
visable="
false"<
;<a
href="reg
ister.php"
;>Login</
a>
visable="
true"<
a
href="pro
file.php"
>Login</a
>
}else{
visable="
true"<
<a
href="log
in.php"&g
t;Login</a&g
t;
visable="
true"<
<a
href="reg
ister.php"
;>Login</
a>
visable="
false"<
;a
href="pro
file.php"
>Login</a
>
}
?>
i just dont
know the code
to make
"<a
href="pro
file.php"
>Login</a
> ect
disaper/show u
understand ?
^^
Visible*
Edited at 08:46:24 pm on 10/22/08
|
Viewed: 14,062 Times | |  |
Genius |
Subject: "re: Help with
Login"
Posted: @ 9:45 pm on Oct 23 2008
|
|
|
 Member #: 582 Rank: user - (77) Since: 02/18/08 Posts: 76 From: kmmk
|
Do something
like this:
in header.php
put something
like this:
Code:
if
($_SESSION['lo
gged_in'] ==1)
{
$user_msg =
"<a
href=\"a
ccount.php\&q
uot;>My
Account</a&g
t;";
} else {
$user_msg =
"<a
href=\"l
ogin\"&g
t;Login
Here</a>
";
}
then just echo
$user_msg to
whereever you
would like it
to appear.
|
Viewed: 14,034 Times | |  |
bs0d |
Subject: "re: Help with
Login"
Posted: @ 11:59 pm on Oct 23 2008
|
|
|
 Member #: 1 Rank: Admin. - (1,510) Since: 02/06/05 Posts: 604 From: USA
|
yes, echo(); is
what you're
looking for.
|
Viewed: 14,031 Times | |  |
wekiller |
Subject: "re: Help with
Login"
Posted: @ 6:00 am on Oct 24 2008
|
|
|
Member #: 773 Rank: user - (4) Since: 10/22/08 Posts: 4
|
Thank u so much

|
Viewed: 14,029 Times | |  |
Viewing Page: 1 of 1 |