Creating a View Profile Link
<p>So I'm trying to get a view profile link working so that one user can look at another users profile. After I figure out how to do this I'm sure I can begin working on forum databases and such, but I'm at a standstill.
Say the Username is 'Bob'. Joe is logged in and wants to view Bob's profile.</p>

<pre><code>$id=isset($_GET['id'])?$_GET['id']:-1;
 settype($id , "int");
 if($id&lt;1)
 {
     echo $username;
 }
 ?&gt;
</code></pre>

<p>Is the link I need it to go to. "includes/viewprofile.php" So I'm stuck at how do I create a link for each user that will log in? IE</p>

<pre><code>&lt;a href="includes/viewprofile.php?username='Bob'&gt;Bob&lt;/a&gt;
</code></pre>

<p>But now Joe sees Sally's profile and wants to view her instead.</p>

<pre><code>&lt;a href="includes/viewprofile.php?username='Sally'&gt;Sally&lt;/a&gt;
</code></pre>

<p>All the information on the user page will be displayed with </p>

<pre><code>$result=mysql_query("SELECT * FROM pages WHERE name='Index'");
            while ($row=
            mysql_fetch_array($result))
                {
                echo '&lt;a href="viewprofile.php"&gt;';
                echo $row['nicename'];
                echo '&lt;/a&gt;';

                            }
</code></pre>

<p>Now I would think that the link itself would need to pull upon a variable, but I can't figure out how to do it. The link couldn't be the same every time is all I know for sure, I'm thinking there has to be a way to pull the query for the link itself based upon what the username/nicename displayed is. Thanks for any help.</p>
