|php to create member profile page|
basic info to get started with php
I am integrating a message board and chat system, and really wanting to learn to write some scripts myself, instead of mooching for help at volunteer script boards. So naturally, I come here to mooch!)
I need to create a file so that when my users click on a profile link, they'll view a dynamically created profile page. I'll use php to fill out the html template with data from a users profile table, yes? I'm sure this is a common use of php, I don't know exactly what I'm looking for to use search properly.
I do have the book "database driven website using php and mySql, and I have phpMyadmin to edit tables.
I know I need to create a table with the appropriate fields, and integrate that with my boards system so the user has a way to add data to those field.
But now I'm at actually creating the html page that will display this data, and not sure exact how to name it. somehow, I need to make the view profile link know which user data to include? something like this?
any help, thanks!
Somehow you are going to have to ask them to identify themselves first, correct? User login perhaps? Set a cookie? If so, you would use that variable data to select the correct information from your database.
I'm not sure if I am helping at all here, yet, but if you give some more details perhaps we can give better direction...
I didn't know enough to know how to ask this question, I understand the lack of replies. I am reading thru my book, and will post back with exactly what I mean in terms you can all understand, just give me 3 hours. I'm sorry for tossing out a half-baked Q, it's a n00b error.
Well don't be hard on yourself about it. We're all n00b's sometime. :)
we'll be here ;)
ok, how it should work is:
a member clicks on a link associated with a member profile.
a php file extracts the profile field data (location, hobbies, pic, etc) from my members table fields and inserts it into pre-defined places in the html template, presented by the browser.
where I'm stuck is, the link itself would have to pass the query string, or bring up a from that asks the user for the member name to query on. yucky solution. Somehow, I need to make the link pass on the variables required, but get the Values from what? the page that link was found on? something that tells php go get the scoop on mary and put it in that html template.
I can see hard coding the link with the variables in a spot like a chat room where you clik on a members name to pull up info, and there's a place for a url there, but will I have to create that link by hand for each member, or is there some way to have the query string dynamically rendered?
Ok, I still didn't explain that very well, but I can see how maybe thinking of a widget catalogue being used the same way. One page would list all products, and a link at each pic might go to a template page of more info. but the list would have to be hand coded for Each php file with the named variables?
~who thanks god you guys don't charge by the word around here...
I'm assuming the link will be on a page where you list all the members along with a link to their profile? I would generate that page dynamically from a database as well.
Actually, it will be in two other places as well. In the chat area, a small form comes up if you clik on a members name, and that can be configured to hold a link to a profile url.
Also, in the message boards area, I can add the profile url to the usual board communicate options, along with home page, PM and im links.
Then of course, it should be listed in the message board members list.
Well, actually, the "duh me" example would be the link to my profile on the topic view. If you wag a mouse over it, it says:
"shortcut to vewprofile.cgi?action=view&member=dladybug"
How is that "url" generated?