# How to redirect based on Access level in Dreamweaver



## amitava82 (Nov 19, 2007)

Say, I have 2 access-level: 1 is for "user" and 2 is for "admin"

When a user logs in, if the access level is 1 then the user must be redirected to welcome.php and if the user has a access-level 2 then he/she will be redirected to admin.php

So, how do i do it in Dreamweaver CS3? I don't know much about php, so easy please..


----------



## ray|raven (Nov 19, 2007)

What are using as base for ur web-app?
JSP?ASP?
You need to use one of em to retrieve userid's/passwords and for redirection to different webpages on logon.

Regards,
ray


----------



## amitava82 (Nov 19, 2007)

Its PHP - MySql as you can see from my redirection page names..

And I have done everything related to user login system. I'm stuck with redirection thing..


----------



## ray|raven (Nov 19, 2007)

Oops!Sorry mate.Missed the obvious part of the post. 
Sorry cant help u there,i dont know nuthin bout PHP.
If it was JSP/ASP i cud've helped u.

EDIT:Found a link that might help u,

```
*www.devnewz.com/devnewz-3-20040326RedirectingaPageUsingPHP.html
```

Regards,
ray


----------



## amitava82 (Nov 20, 2007)

Thanks pal. I got the idea from the link you provided. Here is the code I used to redirect:

```
<?php
if ($_SESSION['MM_UserGroup'] == 2)
{
header('Location:admin.php');
}
?>
```


----------

