rallokkcaz Posted August 22, 2006 Share Posted August 22, 2006 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 thtbut 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!! Quote Link to comment https://forums.phpfreaks.com/topic/18323-user-profiles/ Share on other sites More sharing options...
CircularStopSign Posted August 22, 2006 Share Posted August 22, 2006 i would love to know this too :) good question Quote Link to comment https://forums.phpfreaks.com/topic/18323-user-profiles/#findComment-78720 Share on other sites More sharing options...
Chevy Posted August 22, 2006 Share Posted August 22, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/18323-user-profiles/#findComment-78723 Share on other sites More sharing options...
ober Posted August 22, 2006 Share Posted August 22, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/18323-user-profiles/#findComment-78724 Share on other sites More sharing options...
Yesideez Posted August 22, 2006 Share Posted August 22, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/18323-user-profiles/#findComment-78729 Share on other sites More sharing options...
trq Posted August 22, 2006 Share Posted August 22, 2006 Didn't I answer this in another of your threads yesterday? Quote Link to comment https://forums.phpfreaks.com/topic/18323-user-profiles/#findComment-78852 Share on other sites More sharing options...
Yesideez Posted August 22, 2006 Share Posted August 22, 2006 I think half of the board did! Quote Link to comment https://forums.phpfreaks.com/topic/18323-user-profiles/#findComment-78855 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.