Note that there are some explanatory texts on larger screens.

plurals
  1. POIf account type x include y?
    text
    copied!<p>I am trying to direct one set of users <code>Basic</code> to one type of profile page <code>mod_profile.php</code> and another set of users <code>upgraded</code> to a different profile page <code>mod_account.php</code>. So far, I have this but it seems to be having trouble. I am getting errors when I open up <code>mod_account.php</code> about it not being able to redeclare certain functions from <code>mod_profile</code> or the other profile page, but I dont understand why, I only want one of the pages to load for each user type. </p> <p>Can someone please advise me what I am doing wrong?</p> <p>My <code>profile.php</code> page:</p> <pre><code> &lt;?php $page_title = "Profile"; include('includes/header.php'); include ('includes/mod_login/login_form2.php'); // GET PROFILE ID FROM URL if (isset ($_GET['id'])) { $profile_id = $_GET['id']; } ?&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") { include("includes/mod_profile/mod_profile.php"); } $profile_info3_set = get_profile_info3(); while ($profile = mysql_fetch_array($profile_info3_set)) if (isset ($profile_id)) if ($user['account_type'] == "Basic ---------- ") { include("includes/mod_profile/mod_account.php"); } ?&gt; &lt;script type="text/javascript" src="assets/js/jquery.prettyPhoto.js"&gt;&lt;/script&gt; &lt;?php include('includes/footer.php');?&gt; </code></pre> <p>my defined function code:</p> <pre><code> // profile functions function get_user_info() { global $connection; global $profile_id; $query = "SELECT * FROM ptb_users WHERE id = \"$profile_id\" AND account_status = \"Active\" "; $user_info_set = mysql_query($query, $connection); confirm_query($user_info_set); return $user_info_set; } function get_profile_info() { global $connection; global $profile_id; $query = "SELECT * FROM ptb_profiles, ptb_users WHERE ptb_profiles.user_id = \"$profile_id\" AND account_type = \"Basic\" AND ptb_profiles.user_id = ptb_users.id"; $profile_info_set = mysql_query($query, $connection); confirm_query($profile_info_set); return $profile_info_set; } function get_profile_info3() { global $connection; global $profile_id; $query = "SELECT * FROM ptb_profiles, ptb_users WHERE ptb_profiles.user_id = \"$profile_id\" AND account_type = \"Upgraded\" AND ptb_profiles.user_id = ptb_users.id"; $profile_info3_set = mysql_query($query, $connection); confirm_query($profile_info3_set); return $profile_info3_set; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload