title: if user is blocked php include page, else include other?
body: <p>Can someone please help me, i am trying to incorporate this piece of code:</p>
  
  <pre><code>&lt;?php
  $blocked_users = blocked_users();
  while ($block = mysql_fetch_array($blocked_users)) {
  if ($block['blocked'] == '1')  {
  include("includes/mod_profile/mod_blocked.php");
  }
  }
  ?&gt;
  </code></pre>
  
  <p>to fit this piece of code as an else statement:</p>
  
  <pre><code>$profile_info_set = get_profile_info();
  while ($profile = mysql_fetch_array($profile_info_set)) 
  
  
          if (isset ($profile_id))
          if ($user['account_status'] == "Active")
          if ($user['account_type'] == "Escort") {
          include("includes/mod_profile/mod_profile.php");
  
          }
  </code></pre>
  
  <p>I have a table in my database that puts a users block status from 0 to 1. and if a user blocks someone and that user tries to access their profile then i am trying to make it so that the user goes to another page that says blocked. i am doing this through <code>&lt;?php include(.. ?&gt;</code></p>
  
  <p>At the moment i just tried putting this at the top of the page:</p>
  
  <pre><code>&lt;?php
  $blocked_users = blocked_users();
  while ($block = mysql_fetch_array($blocked_users)) {
  if ($block['blocked'] == '1')  {
  include("includes/mod_profile/mod_blocked.php");
  
  
  
                  }
  }
  ?&gt;
  </code></pre>
  
  <p>and whilst it is working and including the page mod_blocked.php its also bringing up mod_profile.php which is the default profile page and overlapping. So basically if a users not blocked they should go to mod_profile.php and if a users blocked they go to mod_blocked.php.</p>
  
  <p>can someone please show me where im going wrong and how to achieve this?</p>
  
  <p>Here's the entire page of code:</p>
  
  <pre><code>&lt;?php
          $page_title = "Profile";
          include('includes/headerframe.php');
  
  
      // GET PROFILE ID FROM URL
      if (isset ($_GET['id'])) {
          $profile_id = $_GET['id'];
      }
      ?&gt;
      &lt;?php
      $blocked_users = blocked_users();
      while ($block = mysql_fetch_array($blocked_users)) {
      if ($block['blocked'] == '1')  {
      include("includes/mod_profile/mod_blocked.php");
  
  
  
                      }
      }
      ?&gt;
  
  
      &lt;?php
      $user_info_set = get_user_info();
      if (!$user = mysql_fetch_array($user_info_set)) {
          include ('includes/mod_profile/mod_noprofile.php');
  
      }
  
          else if (!isset($profile_id)) {
                          include("includes/mod_profile/mod_noprofile.php");
                      }
  
      $profile_info_set = get_profile_info();
      while ($profile = mysql_fetch_array($profile_info_set)) 
  
  
          if (isset ($profile_id))
          if ($user['account_status'] == "Active")
          if ($user['account_type'] == "Escort") {
                          include("includes/mod_profile/mod_profile.php");
  
  
  
                      }
  
                      else if ($block['blocked'] == '1')  {
                          include("includes/mod_profile/mod_noprofile.php");
                      }
  
  
  
  
  
                      $profile_info3_set = get_profile_info3();
      while ($profile = mysql_fetch_array($profile_info3_set)) 
  
          if (isset ($profile_id))
          if ($user['account_status'] == "Active")
          if ($user['account_type'] == "Client") {
                          include("includes/mod_profile/mod_account.php");
                      } 
  
  
  
      ?&gt;
  </code></pre>