Location: PHPKode > projects > Druid Defect Control > defectcontrol_0.9.4/tts/userlookup.php
<?php require_once 'usercheck.php' ?>
<?php require_once 'genform.php' ?>

<html>
<head>
<title>User options</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css">
</head>

<body bgcolor="#FFFFFF">
<?php include 'header.php'; ?>
<?php ttdb_connect($db); ?>
<h1>User directory</h1>

<p>Here you can view the public profile of registered users. </p>
<p><?php if ($userqname == "") {?>Enter the username you want to search for. </p>
<form method="post" action="userlookup.php">
<table width="100%" border="0" cellpadding="2" class="tableStyle">
  <tr> 
    <td class="tableFieldName" width="10%">User name:</td>
    <td class="tableFieldContent" width="90%"> 
      <input type="text" name="userqname" size="50" maxlength="20">
    </td>
  </tr>

</table>
</form>

<?php } else {?>

<?php 

    require_once 'errors.php';
    
    $user = ttdb_execQuery($db, "select * from users where sname = '$userqname'");

    $userInfo = ttdb_getArray($user);

    if (!is_array($userInfo)) {
        tter_errorWithBackButton("The requested user ($userqname) has not been found ".
            "in the database. Please, check that you typed it correctly.");
        exit();
    }

?>


<p>Showing profile for user: <b><?php echo $userqname ?></b> </p>
<table width="100%" border="0" cellpadding="2" class="tableStyle">
  <tr> 
      <td class="tableFieldName" width="30%">Email address</td>
      <td class="tableFieldContent" width="70%"> 
        <?php echo $userInfo['semail'];?>
      </td>
  </tr>
  <tr> 
      <td class="tableFieldName" width="30%">Contact phone</td>
      <td class="tableFieldContent" width="70%"> 
        <?php echo $userInfo['scontactphone'];?>
      </td>
  </tr>
  <tr> 
      <td class="tableFieldName" width="30%">Contact address</td>
      <td class="tableFieldContent" width="70%"> 
        <?php echo $userInfo['scontactaddress'];?>
      </td>
  </tr>

</table>

<?php ttdb_close($db); ?>

<?php } // if $userqname=="" ?>

<p>&nbsp;</p></body>
<?php include 'footer.php'; ?>
</html>
Return current item: Druid Defect Control