rendered paste body<?
include = "access.php";
function search() {
global $prefix;
if (!isset($_POST['react']) && !isset($_POST['showform'])) {
$react = 'no';
$showform = 'yes';
} else {
$react = $_POST['react'];
$showform = $_POST['showform'];
}
if ($react == 'add') {
$username = $_POST['username'];
$find = mysql_query("SELECT id FROM ".$prefix."users WHERE username='".quote_smart($username)."' LIMIT 1") or die("Cannot get ID: ".mysql_error());
if(mysql_num_rows($find) > 0) {
$id = mysql_result($find, 0, "id");
echo "User details found, continuing....
<meta http-equiv='refresh' content='1;URL=index.php?op=members&task=view&id=".$id."'>";
} else {
echo "<div align=\"center\"><span style=\"color:red;\">User not found, try again</span></div>";
$showform = 'yes';
}
}
if ($showform == 'yes') {
echo "<h5 align=\"center\">Member Search</h5>
<div align=\"center\">Type the username below:</div>
<form name='add' method='post' action=''>
<table align=\"center\">
<tr><td>
<input type='text' name='username' id='keyword' class='textarea' autocomplete='off' size='23' tabindex=\"1\" />
<input type='submit' name='Submit' value='View Details' class='textarea' tabindex=\"2\" />
<input type='button' value='Cancel' onclick=\"javascript:location='index.php?op=admins'\" class='textarea' tabindex=\"3\"/>
<input type='hidden' name='react' value='add' />
<input type='hidden' name='showform' value='no' />
</td></tr>
<tr><td align=\"left\">
<div align='left' id='suggestions' style='width:160px; height:200px;'> </div>
</td>
</tr>
</table>
</form>";
}
}
?>