Jump to content

need help with session


jeppers

Recommended Posts

he there i am a newbe at this but i hope you will help me

 

my problem is that i can't get my session to work

 

i want to give user areas but i have no idea on how to do it.. i do have a session up which direct you to a login page but i don't no how to define an area hear is my code please help man in destress arrrrrrrrrr

<?php
include('title.inc.php');
// include MySQL connector function
if (! @include('mysql\conn_mysql.inc.php')) {
  echo 'Sorry, page unavailable';
  exit;
  }

 

thanks

Link to comment
Share on other sites

sorry i copied the wrong script

 

session_start();
// if session variable not set, redirect to login page
if (!isset($_SESSION['authenticated'])) {
  header('Location: http://localhost/login.php');
  exit;
  }
?>

Link to comment
Share on other sites

you need to be able to assign another session variable and set its value to the area(s) that they have access to. This could be one directory in your site or an array of values that could be checked against the the database to help control access to pages.

Link to comment
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.