title: Let users visit other users (profiles) in my own written social community?
body: <p>The thing I'm asking for is how the users can visit other users profile.</p>
  
  <p>The past week I have been scripting a social network I'm doing, and I'm kind of stuck right now.</p>
  
  <p>I don't know where to start and read or anything.</p>
  
  <p>So I'm asking you guys to kindly help me =)</p>
  
  <p>Im thinking of the url to be like <code>user.php?id=123</code> looking and get user you are visiting to show up instead of "you" wich is at <code>user.php</code>!</p>
  
  <p>Live demo: <a href="http://social.swipper.org" rel="nofollow">http://social.swipper.org</a></p>
  
  <p>EDIT #2:</p>
  
  <p>Here's the current code i got inside user.php :</p>
  
  <pre><code>&lt;?php
  session_start();
  if($_SESSION['username']) {
      include "config.php";
  
      $username = $_SESSION['username'];
      $fetcher = mysql_query("SELECT * FROM userinfo WHERE username='$username'");
  
      while ($data = mysql_fetch_assoc($fetcher)){
          $firstname = $data['firstname'];
          $lastname = $data['lastname'];
          $gender = $data['gender'];
      }
  
      // get user's profile image
      if (file_exists("users/$username/profile.jpg")) {
              $userPhoto = "&lt;img class='pic' src='users/$username/profile.jpg' width='90%' height='30%' /&gt;";
      }
      elseif (!file_exists("users/$username/profile.jpg")) {
              $userPhoto = "&lt;img class='pic' src='http://www.uavmedia.com/portal/images/no-user.jpg' width='90%' height='30%' /&gt;";
      }
      // the user's profile image is fetched
  
      // henter profil text
      $file = "users/$username/bio.txt"; 
      $contents = file($file);
      $profile_text = implode($contents);
      // ferdig å hente profil text, vil nå echo ut profil siden.
      // henter profil stilsett
      $file2 = "users/$username/style.css"; 
      $contents2 = file($file2);
      $profile_style = implode($contents2);
      // ferdig å hente profil stilsett.
  
      echo
      "
      &lt;!doctype html&gt;
      &lt;html lang='en'&gt;
      &lt;head&gt;
          &lt;title&gt;Social FW&lt;/title&gt;
          &lt;meta name='Description' content='A Social network for everyone. Come join us!' /&gt;
          &lt;meta name='Keywords' content='Social, Network, Framewerk, Framework, FW, Open-Source, Free' /&gt;
          &lt;link rel='stylesheet' type='text/css' href='user_files/style.css' media='screen' /&gt;
          &lt;link rel='stylesheet' type='text/css' href='SFW_files/style2.css' media='screen' /&gt;
  &lt;style type='text/css'&gt;
  $profile_style
  &lt;/style&gt;
          &lt;link rel='icon' href='SFW_files/favicon.ico' media='screen' /&gt;
          &lt;script type='text/javascript' src='http://code.jquery.com/jquery-latest.js'&gt;&lt;/script&gt;
          &lt;script type='text/javascript' src='SFW_files/scripts/login.js'&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
      &lt;div id='top'&gt;
          &lt;h1&gt;Swipper.org&lt;/h1&gt;
      &lt;/div&gt;
      &lt;div id='side-menu'&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;a href='user.php'&gt;&lt;b&gt;".$username."&lt;/b&gt;&lt;/a&gt;&lt;/li&gt;&lt;br/&gt;
              &lt;li&gt;&lt;a href=''&gt;Inbox&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href=''&gt;Guestbook&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href=''&gt;Friends&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href=''&gt;Pictures&lt;/a&gt;&lt;/li&gt;&lt;br /&gt;
  
              &lt;div id='showOptions'&gt;&lt;li&gt;&lt;a href='#'&gt;Edit Profile&lt;/a&gt;&lt;/li&gt;&lt;/div&gt;
                  &lt;div id='editOptions' style='display:none;'&gt;
  &lt;pre class='user_info'&gt;&lt;b&gt;&gt;&lt;/b&gt;&lt;a href='changeText.php'&gt;Edit Profile Text&lt;/a&gt;
  &lt;b&gt;&gt;&lt;/b&gt;&lt;a href='changeCss.php'&gt;Edit Stylesheet(CSS)&lt;/a&gt;
  &lt;b&gt;&gt;&lt;/b&gt;&lt;a href='changeProfilePic.php'&gt;Change Profile Image&lt;/a&gt;&lt;/pre&gt;
                  &lt;/div&gt;&lt;br /&gt;
              &lt;a href='logout.php'&gt;&lt;b&gt;Logout&lt;/b&gt;&lt;/a&gt;
          &lt;/ul&gt;
      &lt;/div&gt;
      &lt;div id='side-left'&gt;
      &lt;!-- START USER PIC --!&gt;
              &lt;center&gt;
                  $userPhoto&lt;br /&gt;
              &lt;/center&gt;
      &lt;!-- END USER PIC --!&gt;
      &lt;!-- START USER INFO --!&gt;
              &lt;br /&gt;
              &lt;h3&gt;&lt;pre class='user_info'&gt;User Info&lt;/pre&gt;&lt;/h3&gt;
                  &lt;pre class='user_info'&gt;Name: ".$firstname." ".$lastname."&lt;br /&gt;Sex : $gender&lt;/pre&gt;
      &lt;!-- END USER INFO --!&gt;
      &lt;/div&gt;
      &lt;div id='box_center'&gt;
          &lt;h2 style='font-size:30px;' align='center'&gt;$username&lt;/h2&gt;
              &lt;hr /&gt;
          &lt;br /&gt;
          $profile_text
      &lt;/div&gt;
      &lt;div id='footer'&gt;
          &lt;p align='center'&gt;Swipper.org &amp;copy; All rights reserved. 2010-2012&lt;/p&gt;
      &lt;/div&gt;
  
      &lt;/body&gt;
      &lt;/html&gt;
      ";
  }
  else {
      die("You need to login first or register. You can register/login &lt;a href='index.php'&gt;here&lt;/a&gt;!");
  }
  ?&gt;
  </code></pre>
  
  <p>and when the url is like: user.php?id=3 i want to get the user with userid 3 to show up, and get user #3's information instead of the "user" who wants to visit other people.</p>