Login system - help...
- From: "Nosferatum" <John.Olav.O@xxxxxxxxx>
- Date: 19 Mar 2007 06:57:12 -0700
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)
?>
.
- Follow-Ups:
- Re: Login system - help...
- From: Jerry Stuckle
- Re: Login system - help...
- From: Ja NE
- Re: Login system - help...
- Prev by Date: Display Errors is both On and Off
- Next by Date: Re: Login system - help...
- Previous by thread: Display Errors is both On and Off
- Next by thread: Re: Login system - help...
- Index(es):
Relevant Pages
|