PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
The basic idea behind what you want to achieve is to get something from the database that is unique to each user and use this as a reference when selecting information from the db. I often use an auto-incrementing primary key for this purpose. This value is placed inside a hyperlink (page.php?id=3) and accessed by $_GET['id']. When you click the link you will select all information that you want to use that has the id of 3 inside the database.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
It is quite difficult to read through your script due to the amount of blank lines and the absence of indentation of code blocks. In general, though, I can think of various ways that a user's profile might be stored, and the process of displaying the profiles depends on what is stored and how it is stored (is it in the same table that you are going through or a different one? Does it contain images? etc.). Then how will you want to display the profile? A separate page? A pop-up? A display on the same page without closing the main page? The general approach is that you have to send the data necessary to display the profile of each member as part of the item you are displaying in the list. So it could be a hyperlink ("anchor" tag) or it could be a call to a Javascript function that uses AJAX to return to the server for more data, etc.
The idea is, so when you click a members name, then a new page loads which is to be their profile.
Like is does on this forum/Facebook
Im still learning PHP, So please bare with me.
If you look at this page http://www.sketchedneo.com//staff.php you can see the "staff" profile layout, However I want all user Profiles to show when yo click their name on the forum, So each user has their own profile page, Make sense?
I have a forum, Which members have to register to use.
However I want the forum to link to member's profiles, Like it does here.
My database is all set up for this as far as I can see.
Also I am yet to make the design for the profile pages, Shall i do this now?
Using an auto-incrementing primary key, How do I do this?
My Members database is laid out like:
username varchar(200) latin1_swedish_ci No 0
password varchar(216) latin1_swedish_ci No 0
security varchar(200) latin1_swedish_ci No
email varchar(216) latin1_swedish_ci No 0
ip varchar(200) latin1_swedish_ci No
rank varchar(216) latin1_swedish_ci No 0
name varchar(30) latin1_swedish_ci No
age varchar(40) latin1_swedish_ci No New Born :3
gender varchar(40) latin1_swedish_ci No
location varchar(40) latin1_swedish_ci No
helpfaerie int(11) No 1
profile text latin1_swedish_ci No
about text latin1_swedish_ci No
tasks text latin1_swedish_ci No
joined varchar(216) latin1_swedish_ci No 0
laston int(200) No 0
icedmutereason text latin1_swedish_ci No
icedmutedetails text latin1_swedish_ci No
icedmuteby varchar(200) latin1_swedish_ci No 0
icedmutedate int(200) No 0
posts int(11) No 0
signature varchar(216) latin1_swedish_ci No 0
avatar varchar(216) latin1_swedish_ci No 0
neohtml text latin1_swedish_ci No
siggy text latin1_swedish_ci No
verify int(11) No 0
dpass int(1) No 0
Ellie123 wrote:The idea is, so when you click a members name, then a new page loads which is to be their profile.
This line describes quite adequately what you have in mind;
Ellie123 wrote:Like is does on this forum/Facebook
The PHPDN forum uses a similar method to what i describe; for example your profile can be accessed by clicking on this link memberlist.php?mode=viewprofile&u=367029
The 'mode' option contains 'viewprofile' describing what to do and 'u' contains a value unique to your record in the database.
Ellie123 wrote:Also I am yet to make the design for the profile pages, Shall i do this now?
A full working page isn't necessary at this stage imo, first get the code that will retrieve data for each user working; then you can style / design the page.
If you want a php server side method, no javascript, then this method will work for you
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Just so we understand, how much experience do you have with writing PHP scripts and HTML? Did you write the scripts that you showed us, or is this a package that you acquired from somewhere else? We will try to help you, but if you have absolutely no experience with writing PHP, it is going to be rather difficult.