how do i design view and edit profile page for members?

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!

Moderator: General Moderators

Post Reply
adsegzy
Forum Contributor
Posts: 184
Joined: Tue Jul 28, 2009 9:26 am

how do i design view and edit profile page for members?

Post by adsegzy »

Hello, Please i need your help. I am designing a website for my class and we want it to be a social site. I have designed the registration page, the log-in page, the database and other necessary pages, but i dont know how to design the way each member profile page, which will allow the member to be able to edit his/her profile and for other to view it like people do in FACEBOOK, HI5 etc please it is my contribution to my class kindly help.

regards,
adsegzy
insight
Forum Commoner
Posts: 52
Joined: Tue Jul 07, 2009 9:12 am

Re: how do i design view and edit profile page for members?

Post by insight »

If you can already view users accounts and users can view and edit their accounts then it's as simple as decoration it I guess.

If your looking to actually create a profile page for each member you may need to use something like this:

Code: Select all

<?php
    $page = $_GET['file'];
    $pages = array('News', 'Forum', 'Gallery', 'Admin', 'Shoutbox');
    if (!empty($page)) {
        if(in_array($page,$pages)) {
            include("modules/" . $page . "/index.php");
        }
        else {
            include("modules/Error/notfound.php");
        }
    }
    else {
        include("modules/News/index.php");
    }
?>
Obviously modify it to your own liking. But basically this allows a user to see a page (if in array) so only allow a user to view the edit part of their profile page. The else part shows what the page will look like if the result doesn't match whats in the array, in other words other users. And the last else is for if nothing at all is entered just show (or direct) them to the main page or whatever.

Of course there is probably a much better way of doing this but I'm to lazy to investigate. I nhaven't done the login system on my site yet, I'm finishing up doing the menu and general configurations and site layout before I do that.
Post Reply