I want to show the infomation on my database on a seperate page for each of my users. A Profile page is what I want to make. What ever info you enter, I want to have a page displaying the info you entered. Thanks for any help
@kylixauthorDec 18.2005 — #how do I create that profile page. I have the outline of how I want it to look, but I don't know how to display the infomation from the user. I have to graphics for the page, but not the info.
I populated the db with user info and figured out how it will happen.
I know how to set up a login for a user
But I don't know how to manage sessions.
I kinda of know how to write select statements.
I guess my question is to generic. You see how when you registered for this forum you had to enter a bunch of infomation about yourself. I have form through PHP that did that. What I want is a page that shows that information, something similiar to an user CP. I want your info displayed after you sign up. How do I pull the information from my database and display it on the screen?
@chazzyDec 19.2005 — #Well here are some tips on sessions
- use them
- update them constantly
- don't put any secure information (password, credit card, email address, etc) in them - you can get into their values much easier than a database.
- Use a mix of sessions and database. if you want to keep track of someone's rights, think about how can they change. should these changes happen instantly (on next page view) or on next session? if it's possible that someone will be kicked out, you'll want them kicked out immediately, not after their current session is over. a database can be used to get this stuff on every page view. or even before that if you want to mix in some asynchronous javascript requests.
as for your question
- you want a form to view it? are you familiar with get and post arrays? you can write your select statement to pull up the information for a user based on their get. anyone can [b]view[/b] another's information, depending on access rights, but only 1 person should be able to edit it.
@Reli4ntDec 20.2005 — #basically the minimum you'd need to know regarding sessions is to put session_start() at the head of every page and to create a session variable is as easy as [code=php]$_SESSION['variable'] = $variable;[/code]
take a look at php.net though for more info on [URL=http://us2.php.net/manual/en/ref.session.php]sessions[/URL].
You will really need to learn basic SQL, especially SELECT statements. Mine usually look something like: [code=php]$sql = "SELECT column FROM table WHERE column = 'value'";[/code]
Read up on [URL=http://www.w3schools.com/sql/sql_select.asp]select statements[/URL] and php's [URL=http://us2.php.net/manual/en/ref.mysql.php]mysql functions[/URL] and then experiment.