require ("session.php");
function login_cid() {
global $t;
global $PHP_SELF;
global $pass_email;
global $pass_password;
$db = mysql_connect( "localhost", "mti", "mti" );
if( !db ) {
die("Failed to open database");
}
$ok = mysql_select_db("mti");
if( !ok ) {
die("Unable to access database mti.");
}
$querytorun = " select company_id, profile_id ".
" from profile ".
" where email = '$pass_email' ".
" and password = '$pass_password' ";
$result = mysql_query($querytorun);
if( mysql_errno() ) {
die("
" . mysql_errno().": ".mysql_error()."
");
} else {
if ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$company_id = $row["company_id"];
$profile_id = $row["profile_id"];
if( $company_id == 7 ) { // MTI
if (headers_sent() ) {
echo "Header Sent";
} else {
start_session($profile_id);
Header("Location: http://mti-corp.com/admin");
}
} else if( $profile_id != "" ) { // user
if (headers_sent() ) {
echo "Header Sent";
} else {
start_session($profile_id);
//$url = "Location: login_user.html?pass_profile_id=".$profile_id;
$url = "Location: menu.html?pass_profile_id=".$profile_id;
Header( $url );
}
}
} else { // record not exist
?>
Manufacturing Technologies International Corp.
|
|
|
|
|
Customer Extranet
Your login failed.
Please click here to login again.
|
Manufacturing Technologies International Corp.
1525 Corporate Woods Parkway, Suite 500
Uniontown, Ohio 44685
330.896.2322 fax 330.896.4430 e-mail info@mti-corp.com
|
}
}
}
function display_form() {
global $t;
global $PHP_SELF;
?>