Jump to content

Archived

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

rallokkcaz

User Profiles

Recommended Posts

ok im trying to make a user profiles for the users
on my site and with the ability to edit the profile ive got
no clue how to do tht

but i understand how to add to the database
and i wanna try to make it so when a user creates there account
they get a page with out my manually making it.


help would be great!!

Share this post


Link to post
Share on other sites
When they join just put this:
[code]
mysql_query("INSERT INTO table
(name, whatever) VALUES('There Name', 'whatever' ) ")
or die(mysql_error());
[/code]

Then:
Just echo the info from your mySQL for that user in a text box then send them to a page when the submit it with this code:

[code]
mysql_query("UPDATE table SET row='$varible' WHERE name='$name'")
or die(mysql_error());
[/code]

Of course you have to edit that to your settings

Share this post


Link to post
Share on other sites
I'm going to edit your title... not only is it in all caps, but it is not descriptive of the question.

To answer your question, you need to create the pages to edit and update the profile.  But you only need to create it once.  Then whenever each member goes into the page, you get their information based on their session/cookie login information.

Share this post


Link to post
Share on other sites
OK let's try again, shall we?

First, create a table in your database - let's call it "users" and have some fields like these:
userid (Primary, unique - increases by one every time a new user is added)
username (varchar - holds the name of the user which they also use to log in)
password (varchar - the user's password for logging in)

Next write a script to allow users to register. This script would contain a HTML form to get the data from the user, validate it to make sure its acceptable then when all is ok, insert it into the database.

You'd then have a login page. This would also contain a form to get data from the user. It'd check what the user entered with whats in the database. If both match, set a session variable to say the user has logged in - I tend to use the userid field from the database.

From some sort of menu there would be an option to view a profile. This would be a script to read the chosen user's details from the database and display them.

Now if you look at the ZIP to which I gave you the link, the files that do all this are "register.php", "index.php" and "viewprofile.php"

The exact definitions for all the tables are in the text file, "ivan_yesideez.sql"

Its all there. Once you've figured out how to do that you can then work on adding "fancy" bits like encrypting the password.  Tackle each script one at a time and don't try to run before walking. Might also be an idea to experiment with mini scripts so you know how things work. Learn to walk before trying to run.

Good luck! :D

Share this post


Link to post
Share on other sites
Didn't I answer this in another of your threads yesterday?

Share this post


Link to post
Share on other sites

×

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.