Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-29-2006, 12:30 PM   PM User | #1
managedinternet
New Coder

 
Join Date: Aug 2006
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
managedinternet is an unknown quantity at this point
Session Problem - Urgent Help Needed

Hi Guys,

ok here is my problem

on my site i have 2 login pages, they both redirect to different locations
( for personal and business users )

After successfull login they create a session
called either 'business' or 'personal' and the value for the sessions
is the auto_increment id inumber

on the index page in the corresponding folders
personal or business, the code check for the corresponding session name

however my problem is that if i login as business i can then also access the personal area and vise versa

Here is the code from 1 of the login pages ( they are both similar with only name changes )

PHP Code:
session_start();
mysql_select_db($dbn$dbc);
$loginquery mysql_query("SELECT * FROM `business` WHERE email='$email' and password='$password'"$dbc);
$result mysql_fetch_assoc($loginquery);
// Result Process
if(!$result){
header("Location: buslogin.php?message=Invalid Username / Password</br>Please Try Again");
} else {
$GLOBALS['business'] = "$result[businessid]";
session_register('business');
header("Location: business/index.php");

and here is the code on the page successfull login is redirected too
PHP Code:
session_start();
if(!isset(
$_SESSION['business'])){
header("Location: ../buslogin.php");
} else { 
anyone got any ideas as to why if im logged in and the session name business is set i can access a page that checks for a session called personal ?

this is extremely urgent as teh site is supposed to be going live in 2 days time, but i cant let it go live like this

please help

chris
managedinternet is offline   Reply With Quote
Old 08-29-2006, 12:47 PM   PM User | #2
managedinternet
New Coder

 
Join Date: Aug 2006
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
managedinternet is an unknown quantity at this point
guys,

i found the problem

on the login page at the top ( the form page which passes the data to the page i posted )

i checked the sessions but the location for successful redirection was the same

so that was the issue

regards
chris
managedinternet is offline   Reply With Quote
Old 08-29-2006, 06:13 PM   PM User | #3
amir
Regular Coder

 
Join Date: Mar 2005
Location: Pakistan
Posts: 207
Thanks: 0
Thanked 0 Times in 0 Posts
amir is an unknown quantity at this point
thats the best thing if u solve ur problem urself
with best wishes
__________________
God helps those who help others.
amir is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:08 PM.


Advertisement
Log in to turn off these ads.