Hi, I am trying to read in a testscore from the query ($LoginRS__query=sprintf) below, and use this to redirect the users after they log onto the site to the pages in the if/else statements.
I am trying to replace ($MM_redirectLoginSuccess = "modeselection.php";) line with the if/else statement. I do not know how to extract the testscore field from the query below and compare it to the values in the if/else statement.
Here is the code to date.

Can anyone help?
Fletch lives
<?php require_once('Connections/logininfo.php'); ?><?php
// *** Validate request to login to this site.
session_start();
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($accesscheck)) {
$GLOBALS['PrevUrl'] = $accesscheck;
session_register('PrevUrl');
}
if (isset($_POST['txtusername'])) {
$loginUsername=$_POST['txtusername'];
$password=$_POST['txtpassword'];
$MM_fldUserAuthorization = "";
if ($testscore <= 0.965)
{
$MM_redirectLoginSuccess = "r1j1txt.php";
}
elseif ($testscore >= 1.060)
{
$MM_redirectLoginSuccess = "r1j1img.php";
}
elseif ($testscore > 0.965 and $result < 1.060)
{
$MM_redirectLoginSuccess = "r1j1imgtxt.php";
}
//$MM_redirectLoginSuccess = "modeselection.php";
$MM_redirectLoginFailed = "errorlogin.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_logininfo, $logininfo);
$LoginRS__query=sprintf("SELECT username, password, testscore FROM logininfo WHERE username='%s' AND password='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $logininfo) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$GLOBALS['MM_Username'] = $loginUsername;
$GLOBALS['MM_UserGroup'] = $loginStrGroup;
//register the session variables
session_register("MM_Username");
session_register("MM_UserGroup");
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>