View Full Version : Resolved dynamic profile display
AdrielGreene
04-28-2009, 11:01 PM
Hello Dynamic Drive!
I am creating a member website which can display profiles to the public. I have set up a login and control panel where the member can edit the content of their profile. Now I am trying to create a search (simple list with bullets form) and profile display. As I understand it, when the user selects a member from the list, they can be brought to the profile page with the members information. What If I want the user profile to be several different pages? How would I hold on to the information called from the MySQL while the user looks at several different pages?
If someone has an idea or can put me in the right direction It would be very relieving. I will post back here if I have any developments.
Do you mean you want many pages for each user, or pagination? If you were to do pagination, then set a session, and break it when they're off search.
AdrielGreene
04-29-2009, 04:58 AM
Thanks for the advice Nile!
I want to have a search page which queries the members, that seems easy enough. I am confused about having 5 different pages associated with that member once you select their profile from the search list. I'll check into setting sessions for the public; I thought that was only for logged in members. I am just picking PHP up so your help sending me in the correct direction is wonderful.
I'll look into sessions right away and see what I can dig up.
Sessions are for any body that visit the site. I mean the set a session with the search query, that way you don't have to send a get/post variable with the pagination.
amutha
04-30-2009, 07:37 AM
you try this
http://www.codediesel.com/php/simple-pagination-in-php/
AdrielGreene
05-01-2009, 05:24 AM
Ok, now I understand. Thank you for the link Amutha. I have developed pagination for my search. It displays the members of my site properly, and will make multiple pages in order of the case selected. It prints like this:
Last Name-First Name-Date-Registered--State-Profile
Arguile-----Joe--------April 06, 2009----NJ----joey
Smith ------Kathy-----April 26, 2009----NY---K-bomb
In the Profile column I am trying to place links to their respective profiles, ideally in the form of a hyper link(but functionality comes first). I am not very familiar with sessions but from what I can gather from Nile I need to put code like this on top of my pagination code:
session_destroy();
session_start();
I'll add an IF statement so the destroy statement doesn't output an error.
Right now the profile column is in the form of hyperlinks which direct to sub-domains like http://joey.website.com. Sub-domains would be nice to implement but for now I'm just stuck on the session.
Is there a way to have the session information call data from a MySQL DB and redirect with the hyper-link which then fills the profile pages? Should I be looking at forms instead? Am I just looking at this from a completely incorrect perspective? I feel like I dug myself into a pit of web-architecture confusion.
AdrielGreene
05-07-2009, 08:54 AM
I got it! The Paginated search gives buttons for different .php files. The .php files are named after the field Profile_ID in my database. they are created when the member makes his/her account. They then fill the session variables where $_POST equals the Profile_ID field in my database. These display in Profile.php
For example:
I click on Danny whose Profile_ID is "DanDaMan". The link in the paginated search brings me to "DanDaMan.php". DanDaMan.php queries SELECT profile fields WHERE DanDaMan(name of current file) = Profile_ID. It then redirects the user to Profile.php. Profile.php fills in with $_SESSION from DanDaMan.php
Thank you both very much for the aid, it was much needed and very productive.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.