ok this is working now
...thank you....code below shows how it`s done, only question now is how to change this line
if ($_SESSION['companyname'] == 'Cemex Mexico')
to something like
Like if ($_SESSION['companyname'] == 'Cemex Mexico' or 'Cemex Central' )
this is how was done
$strSQL = 'SELECT company, user, ID from employees_selex where user = "' . $_POST['user'] . '" and ID = "' . $_POST['pass'] . '"' ;
$res = mysql_query($strSQL);
$x = @mysql_num_rows($res);
first company was added to the SQL Select query code to get the company name. Then, after setting the session variables, this code was used:
so first company was added to the SQL Select query code to get the company name. Then, below, after setting the session variables, use this code was used:
PHP Code:
if ($rs= @mysql_fetch_array($res))
{
$_SESSION['user'] = $rs['user'];
$_SESSION['pass'] = $rs['ID'];
$_SESSION['companyname'] = $rs['company'];
if ($_SESSION['companyname'] == 'Cemex Mexico') {
// redirect to infouser.php
echo "<script>
location.href='infouser.php?band='+1+''
</script>
";
} else {
echo "<script>
location.href='infouse2r.php?band='+1+''
</script>
";
// redirect to infouser2.php
}
while ($row = mysql_fetch_assoc($res)) {
echo $row["Empleado"];
}
} //end if session y redireccion para desplegar informacion en la otra pagina con bandera para identificar si se llego a esa pagina por medio de esta
elseif ($x=='0')
{
$error = "Verifica tu Username y Password";
echo $error;
}//end if error login
}//end submit
?>