# Taking me login form to another level \[php\]

**URL:** <https://forum.kirupa.com/t/taking-me-login-form-to-another-level-php/248951>\
**Category:** programming\
**Created:** [January 13, 2008, 10:43pm UTC](https://forum.kirupa.com/t/taking-me-login-form-to-another-level-php/248951 "2008-01-13T22:43:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisclick](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/chrisclick/32/1991_2.png) [@chrisclick](https://forum.kirupa.com/u/chrisclick)\
**Post date:** [January 13, 2008, 10:43pm UTC](https://forum.kirupa.com/t/taking-me-login-form-to-another-level-php/248951/1 "2008-01-13T22:43:53Z")

</div>

Well, Hello again php gurus!

what im trying to get here is to adapt my current login forms check.php file so it can use member levels

for example  
0 = guest  
1 = member  
2 = admin

if someone logs in with the level 2 they will be taken to admin.php and so forth…

Here is my currect check.php file :

```php

<?php
include('../config/config.php');

// Connect to server and select databse.
$connect = mysql_connect("$dbhost", "$dbuser", "$dbpass")or die("cannot connect");
mysql_select_db("$dbname")or die("cannot select DB");

// username and password sent from signup form
$myusername=$_POST['myusername'];
$in=$_POST['mypassword'];

$symb = array("$", "=", "*", "%", "\";", ");");
$pass = str_replace($symb, "", $in);
$sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$pass'";
$result=mysql_query($sql);

// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){

// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("myusername");
session_register("mypassword");
header("location:admin.php");
}
else {
header("location:task.php?status=0");
}
?>

```

Thank you!!!
