|
|
bs0d |
Subject: "re: Member's
Profile"
Posted: @ 5:43 pm on Jul 18 2007
|
|
|
 Member #: 1 Rank: Admin. - (1,510) Since: 02/06/05 Posts: 604 From: USA
|
Create the page
just like the
signup, except
set the value
of the text
boxes to the
result from the
database. Then,
when the user
clicks submit,
use an UPDATE
query to update
the appropriate
fields with the
values entered
in the text
boxes.
set a condition
on the page
where the user
can only edit
their own
profile (must
be signed in).
Edited at 05:46:01 pm on 07/18/07
|
Viewed: 12,918 Times | |  |
BoricuaLayz |
Subject: "re: Member's
Profile"
Posted: @ 7:06 pm on Jul 18 2007
|
|
|
Member #: 356 Rank: user - (30) Since: 06/25/07 Posts: 44 From: Florida
|
ok i changes
it around a bit
i just added
columns into
the members
table
it was a lot
easier on me
when i did that
so now with
that done how
would i set
variables on a
profile page
where when i
link to a
profile the
link looks like
this
"http://d
omain.com/blahb
lah.php?member=
Admin"
and in the page
all the content
will be pulled
out of Admin's
row
Edited at 07:54:25 pm on 07/18/07
|
Viewed: 12,911 Times | |  |
WintersDance |
Subject: "re: Member's
Profile"
Posted: @ 11:56 pm on Jul 18 2007
|
|
|
 Member #: 353 Rank: user - (27) Since: 06/19/07 Posts: 36 From: California
|
Like bs0d
mentioned, make
it so that the
user has to be
logged in. Then
from his/hers
own profile
page they would
have an option
to edit their
profile. The
page that would
display their
information
would check to
see if they are
logged in
first, then
using the
session name,
would compare
that to the
username in the
DB and then
retrieve those
values and
populate the
form with
it.
Once the values
in the form
have been
changed, then
you send an
UPDATE query
back to the
username in the
DB and update
the new
information.
So your url
would look
something like
this:
<a
href="edi
t_profile.php?m
ember=<?php
echo
$_SESSION['use
rname'];
?>">
;Edit
Profile</a&g
t;
If the user is
logged in, then
the session
name variable
will appear in
the URL. Just
make sure that
sessions are
used to control
that page so
that you can't
just spoof the
username in the
url and access
their account.
|
| Viewed: 12,898 Times | |  |
BoricuaLayz |
Subject: "re: Member's
Profile"
Posted: @ 1:23 am on Jul 19 2007
|
|
|
Member #: 356 Rank: user - (30) Since: 06/25/07 Posts: 44 From: Florida
|
i have
done the edit
profile part
and all of it
works perfect
but now what i
want to do is
make a page
where other
members can
view your
profile. I as
thinking of
nameing
viewprofile.php
and it want it
to call the
members
username
variable in a
link like this
"viewprof
ile.php?member=
Admin"
and the sql
query will get
information
from Admin's
row. How would
i set the
variables to
work like that?
Edited at 01:42:02 am on 07/19/07
|
Viewed: 12,895 Times | |  |
bs0d |
Subject: "re: Member's
Profile"
Posted: @ 3:30 am on Jul 19 2007
|
|
|
 Member #: 1 Rank: Admin. - (1,510) Since: 02/06/05 Posts: 604 From: USA
|
In that case,
you would use
$_GET['member
']. You use
$_GET to
get
variables from
the URL. Also,
be careful when
allowing
visitors to
dictate what
will be used as
a variable in
your queries.
Validate the
input before
continuing with
your query to
be safe.
|
Viewed: 12,885 Times | |  |
Viewing Page: 1 of 1 |
|
|
|