Not sure what I'm missing, newbie here, and am learning as I go...now with the following code, I which is a login page, I am able to bring up the individual pages based upon userlevel without a problem, and am able to pass the username variable to the admin page...however, I cannot pass the companyid variable, and I'm just not sure why, I'm sure I'm missing something, but can't see it....thanks
<?php
include("db_connect.php");
$username = $POST['user'];
$password = $POST['pass'];
$companyid = $POST['company'];
if (!$POST['pass'] && !$POST['user']&& !$POST['company']){
?>
<html><title>Qmanager Test</title><b>Member Login</b>
<br><form method="POST">Username:
<br><input type="text" name="user" value="">
<br>Password:
<br><input type="text" name="pass" value="">
<br><input type="submit" name="submit" value="Login">
<?php
} else {
//mysql_connect ("localhost", "user", "pass") or die ('My SQL Error: ' . mysql_error());
//mysql_select_db ("database");
$query = "SELECT * FROM users WHERE username = '$username' AND password = '$password'";
$result = mysql_query($query);
if (mysql_num_rows($result) == 1)
{
$row = mysql_fetch_assoc($result);
switch ($row[userlevel])
{
case 1:
header ("Location: ./admin.php?username=$username&companyid=$companyid");
break;
case 2:
header ('Location: ./manager.php');
break;
case 3:
header ('Location: ./user.php');
break;
}
} else {
echo 'Sorry your username or password are incorrect or not registered with us. Please try again.';
}
mysql_close($server);
}
?>