$user_id = {login};
$pass = {pswd};
$connection_string = 'Driver=SQL Anywhere 17;SERVER=bos;DATABASE=bos';

$conn = odbc_connect( $connection_string, sc_sql_injection($user_id), sc_sql_injection($pass));
sc_set_global($conn);
[conn] = $conn;
 
if(!$conn) {
	/* if you enter this block, the function called will be from the external library scDisplayUserError in the error.js file.*/
} else {
$check_sql = "SELECT userid, rep_nbr,rep_type,rep_id,last_name,first_name"
. " FROM  DBA.SAS_SECURITY"
. " WHERE SAS_SECURITY.userid = '" .$user_id. "'";

sc_lookup(rs, $check_sql);
[login] = {rs[0][0]};	
[rep_id] = {rs[0][3]};	
[rep_nbr] = {rs[0][1]};	
[rep_type] = {rs[0][2]};
[group_nbr] = {rs[0][1]};		
$f_name = {rs[0][5]};
$l_name = {rs[0][4]};
$rep_nbr = {rs[0][1]};
$rep_type = {rs[0][2]};	
$login = {rs[0][0]};	
sc_redir(menu, f_name = $f_name;l_name = $l_name;rep_nbr = $rep_nbr;rep_type = $rep_type;login = $login);
	
}