Jump to content

Recommended Posts

I have altered a simple member management system from a tutorial for my site. I have the login, logout, etc. all working fine. However I need to understand the concept behing having member pages.

 

Basically I'll have to type of users on my site, host and visitors/users. The host will have pages that they can maintain and broadcast and visitors can view the host pages based on whatever host they select. How do I go about making individual areas for each host upon their login? Sort of like a myspace system.

 

I am able to have a user control panel, see code below, but this is a page that only the host can see. I want a page that a host broadcast and vistors can view.

 

Thanks.

 

<?

session_start();

ob_start();

require_once($_SERVER['DOCUMENT_ROOT'].'/db_connect.php');

require_once($_SERVER['DOCUMENT_ROOT'].'/global.php');

 

//check cookie

if ($_SESSION['logged_in'] != 1 && isset($_COOKIE['login_cookie'])) {

list($user, $pass) = explode('[]', $_COOKIE['login_cookie']);

$qu = mysql_query("SELECT `user_password` FROM `hgl_members` WHERE `username` = '".addslashes($user)."'") or die(mysql_error());

if (mysql_num_rows($qu) == 1) {

$passw = mysql_fetch_object($qu);

if ($passw->user_password == md5($pass)) {

$_SESSION['logged_in'] = 1;

$_SESSION['username'] = $user;

$_SESSION['password'] = $pass;

}

}

}

 

if(!isset($_SESSION['username']) && !isset($_SESSION['password'])) {

$_SESSION['logged_in'] = 0;

$user = "Guest";

echo $html_cpheader;

echo 'You are not logged in and do not have access to this area.';

echo $html_cpfooter;

} else {

echo $html_cpheader;

//I will do user specific database read/writes here

echo $html_cpfooter;

}

?>

Link to comment
https://forums.phpfreaks.com/topic/52553-user-area-members-page/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.