print out the vars to see whats happening such as
var_dump($userRecFound);
make sure it is (int 1) if it isn't the problem is the mysql_query, print out the query check the query runs right and returns 1 row.
if theres still a problem then check mysql_num_rows is setting $userRecFound to 1
on thing i do notice is you are using mysql_fetch_array(); which returns an array with no keys you want mysql_fetch_assoc(); so you can access the variables with their name.
see if this helps work it out, there was a semicolon in the end of your sql query btw
<?php
session_start();
require_once('Connections/connector.php');
if(ctype_alnum($_POST['uid'])){//stop code injection!
$uid= $_POST['uid'];
}else{
$uid = false;
}
echo 'uid '.$uid."\r\n";
$upw = md5($_POST['uPw']);
//manual sql search...
$query = "select * from `user` where `user`.`uid`='$uid' AND `user`.`uPw`='$upw'";
echo 'query '.$query."\r\n";
$userRec = mysql_query($query) or die(mysql_error());
//check number of user records found... only 1
if(@mysql_num_rows($userRec)==1){
$userRecFound = 1;
echo 'record found'.$userRecFound."\r\n";
}else{
echo 'record not found '.$userRecFound."\r\n";
$userRecFound = false;
}
//check if above sql finds a record...
var_dump($userRecFound)."\r\n";
if($userRecFound==1){
//store user id in a session variable for later security...
echo 'userRecFound == 1'."\r\n";
$_SESSION['uid'] = $uid;
while($userRecFetcher=mysql_fetch_array($userRec)){
var_dump($userRecFetcher);
//if user type = admin
if($userRecFetcher['uType']=='admin'){
//header("location: controlPanel.php");
echo 'usertype is admin'."\r\n";
}
//if user type = reg
elseif($userRecFetcher['uType']=='reg'){
//header("location: controlPanelReg.php");
echo 'usertype is reg'."\r\n";
}else{
echo 'usertype had no match'."\r\n";
}
}
}
//if not in database...
else{
//header("location: deny.php");
echo 'access denied'."\r\n";
}