/    Sign up×
Community /Pin to ProfileBookmark

User Profile System

I’m making a website and need a user system, now, I’ve seen many “login/logout” scripts, with only those options, I need a system where users can sign up, and then have a profile, with the option to have an image, and other information. Pretty much a forum profile, with no forum.

But I don’t know how to do this, or where to start, so could anyone tell me of a system similar to this? Or maybe some tutorials that could get me in this direction?

Thanks in advance. ?

to post a comment
PHP

20 Comments(s)

Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYSep 08.2005 — do you have good knowlegde of php and database, e.g. MySQL?
Copy linkTweet thisAlerts:
@chubbiusauthorSep 08.2005 — I have a little knowledge of both, but like I said, I wouldn't know where to start, so I don't know enough to really do this without any help.
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYSep 08.2005 — so you'll have to create a dB with at least (for the user)

1. id

2. username

3. password

4. e-mail

(5. join date)

6. path to img

7+. infos about user...

you'll as well need a register-script, so basically a form where users will be able to enter information, then submit to dB

you'll need a login script, that interacts with the dB as well

an editing script, so that users can edit their profile when they are logged in

a log out script

and i suppose a kind of member list, where people can see other peoples profile
Copy linkTweet thisAlerts:
@chubbiusauthorSep 08.2005 — The registering/login script is no problem, I just don't know how to edit and display the information.
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYSep 08.2005 — well, make a script that loops through the database and prints out every name in a list-like manner and maybe some additional infos, like they do on this forum, and make usernames link to the profil of each user.

to edit, you'll have to make a script that get infos from the database and put them into a form, pretty much like the regitering part, and than updates the database entry when submitted
Copy linkTweet thisAlerts:
@chubbiusauthorSep 08.2005 — Alright, thanks! I'll see what I can do. ?
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYSep 08.2005 — you are welcome ?
Copy linkTweet thisAlerts:
@chubbiusauthorSep 09.2005 — Alright, I've written a simple signup/login script, with id, username, password, etc. Now, how could I display all the information in a preformatted template by using the id number?
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYSep 09.2005 — [code=php]
//connects to dB
$connection = @mysql_connect($db_host, $db_user, $db_password) or die(mysql_error());
[/code]

[code=php]
<?php
$query = "SELECT * FROM users ORDER BY user";
#or order by id, or join date
$result = mysql_query($query, $connection) or die(mysql_error());
#list or table?
echo "<ul>";
for($i = 0; $i < mysql_num_rows($result); $i++){
$user = mysql_result($result, $i, "user");
$id = mysql_result($result, $i, "id");
# etc....
echo "
<li><a href="profile.php?user=$user" title="$user's profile">$user</a></li>";
}
echo "</ul>";
if(mysql_num_rows($result) == 0){
echo "No users suscribed";
}
?>
[/code]
Copy linkTweet thisAlerts:
@chubbiusauthorSep 10.2005 — Yes, that would work, but I don't understand what would go in profile.php, and what would happen when you go to profile.php?user=Bob or 1 or whatever.
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYSep 10.2005 — well, you could do a more detailed profile for that bob for instance
Copy linkTweet thisAlerts:
@chubbiusauthorSep 10.2005 — Haha, I meant what script I'd have to write so that it gets the information from the database, based on whatever member's name goes after the profile.php?user=
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYSep 10.2005 — well, you would get the username or id from the GET array, and then query all where username or id = the current username or id
Copy linkTweet thisAlerts:
@chubbiusauthorSep 11.2005 — Could you give me an example?
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYSep 11.2005 — do you know how to retrieve information from a MySQL database?
Copy linkTweet thisAlerts:
@chubbiusauthorSep 11.2005 — Sort of, yes.
Copy linkTweet thisAlerts:
@SheldonSep 11.2005 — I would make it so that they can only edit their info if there are that person so by calling it with their Sessions username once they are logged in

[code=php]
<?
//SQL QUERY TO SELECT THE USER LOGGED IN
$sql2 = "SELECT * FROM table WHERE username = '". $_SESSION["username"] ."'";
$sql2 = mysql_query($sql2);

//WHILE USERS ARE IN THE DATABASE DO THE FOLLOWING
while($result2 = mysql_fetch_assoc($sql2)) { ?>

[/code]

You could change this
[code=php]WHERE username = '". $_SESSION["username"] ."'[/code]to
[code=php]WHERE id = {$_GET['view']}[/code]

and your link would be
[code=php]<a href='profile.php?view={$result2['id']}' />Edit {$result2['username']}</a>[/code]
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYSep 11.2005 — according to the script above, you should first, when users log in correctly, assign a new session variable with their username or id
Copy linkTweet thisAlerts:
@SheldonSep 13.2005 — Oh yes, true sorry i forgot about that. Nice spotting Lilcrazyfuzzy!

How is it coming along chubbius?
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYSep 13.2005 — don't be afraid to ask! ?
×

Success!

Help @chubbius spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...