I am having a problem with my user list system, I want to make a link to the side of the output users that says, [View Profile], as a hyperlink, when clicked it would take you to the users Profile, I usually would of figured this out by now, however the way I am doing the user list, as to sort the letters out, makes it an impossible task for me to figure out.
<?php
require('config.php');
if(isset($_SESSION['logged_in']))
{
$sql = 'SELECT Uname FROM users ORDER BY Uname';
$result = mysql_query($sql) or die('ERROR: '.$query.' '.mysql_error());
$letterlinks = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$num = mysql_numrows($result);
echo '<a name="top"></a>';
echo '<a href="#number">0-9</a> ';
for ($i = 0; $i < 37; $i++):
echo '<a href="#'.$letterlinks[$i].'">'.$letterlinks[$i].'</a> ';
endfor;
while ($list = mysql_fetch_object($result)):
$letter = strtoupper(substr($list->Uname, 0, 1));
if ($prev_row != '0-9' && is_numeric($letter)):
echo '<br /><a name="number"></a><b><u>0-9</u></b> ';
echo '<a href="top"><i>goto top</i></a><br />';
$prev_row = '0-9';
endif;
if ($letter != $prev_row && !is_numeric($letter)):
echo '<br /><a name="'.$letter.'"></a><b><u>'.$letter.'</u></b> ';
echo '<a href="top"><i>goto top</i></a><br />';
$prev_row = $letter;
endif;
echo $list->Uname."<br />"; [B]/// This is where I want to have the <a href='profile.php?user='Uname>[View Profile]</a>[/B]
endwhile;
echo "<br><br>[".$num."] users";
}else{
echo 'You must be logged in to do this! <meta http-equiv="Refresh" content="2;url=index.php"> ';
}
?>
If you guys could help me that would be a great help!