3
Some other things:
$_GET should be used instead of $HTTP_GET_VARS.
The username should be sanitized prior to using it in a query.
The username needs to be in quotes.
$uid = 0;
if (isset($_GET['usr'])){
$uname_q = MyTextSanitizer::addSlashes($_GET['usr']);
$result = $xoopsDB->query(
'SELECT uid FROM ' .$xoopsDB->prefix('users'). " WHERE uname='$uname_q'"
);
$row = $xoopsDB->fetchArray($result);
$xoopsDB->freeRecordSet($result);
$uid = ($row !== false) ? $row['uid'] : 0;
}