<?
include "admin_header.php";

if(!isset($_GET['u_id'])) { header("Location: admin_users.php"); exit(); }
$u_id = $_GET['u_id'];
if(mysql_num_rows(mysql_query("SELECT u_id FROM bhost_users WHERE u_id='$u_id'")) != 1) { header("Location: admin_users.php"); exit(); }
$user_info = mysql_fetch_assoc(mysql_query("SELECT u_id, username, password, code FROM bhost_users WHERE u_id='$u_id'"));


$user = crypt($user_info[username], $user_info[code]);
$pass = $user_info[password];
$u_id = $user_info[u_id];
setcookie("username", "$user", 0, "/");
setcookie("password", "$pass", 0, "/");
setcookie("u_id", "$u_id", 0, "/");

cheader("../manager/index.php");
exit();

?>