creating a user profile page
Displaying specific user information and activity on a single profile page.
Now that you have a thriving user base who actively upload content and comment on various images, I think it’d be nice to have individual profile pages which have information about each user along with links to the various things they’ve contributed to the site. To achieve this, you’ll need to create a page which lists all of your sites users as well as a page which will only show information about a single user.
So, in Dreamweaver, create and save two new pages as ‘users.php’ and ‘profile.php’. Then on your users page, create a Recordset (Query) called ‘userlist’ which is aimed at your ‘users’ table in your database. Sort it by username ascending so that it will provide you with an alphabetically ordered list. From that recordset, you can then place some content on your page a bit like this:

Highlight the piece of text which displays the username and then using the properties panel, turn it into a link by using the browse for file icon. Point the link to the ‘profile.php’ page, then click on the parameters button. Create a parameter called ‘name’ and give it a dynamic value which pulls the ‘username’ from your ‘userlist’ recordset.

Finally, apply a repeat region behavior to the username link on your page so that it will display all the results from that recordset.

Now open the ‘profile.php’ page and again, create a new Recordset. Call it ‘user’ and set it so that it obtains data from your ‘users’ table but filters the results by a URL parameter called ‘name’, that equals the column of ‘username’. This will ensure that the page only displays information based on the user that has been specified in the URL.

Then use data from that recordset to populate your page.

You can then create recordsets which query your images and comments table respectively, each time filtering the results so that the ‘name’ variable in the URL is used to match against the ‘username’ column in those tables. By using the data from those recordsets, you can construct a page that displays comments and images that your specified user has contributed!

