Login system - help...



please be patient, I am a newbie..

I have three categories of members ($memkat).
Each member got their own unike username and password from mysql db
and all belong to one of the three categories of members.
My mission is to get each member to login and be redirected to a
specific page in a specific folder. It should not be possible for
members from memkat10 to access (index-file) in folder memkat20 and
so on.


My faboulus login and redirect page: (which doesn't work..)

<?php
$host="my_host";
$username="";
$password="";
$db_name="member_db";
$tbl_name="members";

// Connection
mysql_connect("$host", "$username", "$password")or die("cannot
connect");
mysql_select_db("$db_name")or die("cannot select DB");

// Post data
$myusername=$_POST['theusername'];
$mypassword=$_POST['thepassword'];

// query and get the memkat
$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and
password='$mypassword'" and memkat="$memkat";
$result=mysql_query($sql);

//set session
session_register("myusername");
session_register("mypassword");
session_register("memkat");

if($memkat=="10"){
require("/path/to/folder/here1/index.php");
} elseif($memkat=="20"){
require("/path/to/folder/folder2/index.php");
} elseif($memkat=="30"){
require("/path/to/folder/folder3/index.php");
}
?>

In each of the index files in the member folders I thought about
requesting the session data from the login page at top,

Each index file:

<?php session_start(); ?>
if (($myusername["musername"])) ;
if (($mypassword["mypassword"]));
if (($memkat["memkat"]));



include file(therealindex.php)

?>

.



Relevant Pages

  • Re: Login control and restricted member pages
    ... As you said the login dialog prompts each time the page loading a image, ... protected folder. ... When a page display some images file, ... the root members folder isn't. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: How to email "Undisclosed Recipients"
    ... > Undisclosed Recipient I get or any mail not addressed to me, ... > reads "Alumni Members Monthy Newsletter" and then the people it ... select the folder in which you want ... Select a directory service from the drop-down list ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: The meaning of 0/0
    ... distinct from their members. ... Now the phrase_ not(consistent number) is different from (not ... For simiplicity lets call the kind of refutation involved in 1] as the ... File, and a collection of Files to be a Folder, now if we set a ...
    (sci.math)
  • Re: Sending an e-mail to multiple recipients from a group in my ad
    ... group,it's the fact that I have to select one by one the group members. ... select the folder in which you want to create ... The Properties dialog box opens. ... To use a directory service, click Select Members, and then click ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Rights problem - Even the administrator is locked out, but I dont see why
    ... defines the access rights for a number of users. ... you like with the Collection folder, ... will dot pittenger1 at gmail dot com (use this address for large ... I then denied to that group rather than to individual members. ...
    (microsoft.public.windowsxp.general)