session_start(); if (!session_is_registered("LLC")) { // if session check fails, invoke error handler header("Location: error.php?e=1"); exit(); } else { $user = $_SESSION['UNAME']; include("include/dbconfig.php"); $connection = mysql_connect($db_host, $db_user, $db_pass) or die ("Unable to connect!"); $query = "SELECT FirstName, LastName, Title, Extension, Email, Home, Cell, Birthday, Hobbies from userlist WHERE username = '$user'"; mysql_select_db($db_name); $result = mysql_query($query, $connection) or die ("Error in query: $query. " . mysql_error()); if (mysql_num_rows($result) == 1) { $row = mysql_fetch_row($result); $fname = $row[0]; $lname = $row[1]; $title = $row[2]; $ext = $row[3]; $email = $row[4]; $home = $row[5]; $cell = $row[6]; list ($year, $month, $day) = split ('-', $row[7]); $birthday = $month.'/'.$day.'/'.$year; $hobbies = $row[8]; } } ?>