0
我試圖將一組用戶Basic
指向一種類型的配置文件頁面mod_profile.php
,另一組用戶upgraded
指向不同的配置文件頁面mod_account.php
。到目前爲止,我有這個,但似乎有麻煩。當我打開mod_account.php
關於它無法從mod_profile
或其他配置文件頁面重新聲明某些功能時,我收到錯誤,但我不明白爲什麼,我只希望爲每個用戶類型加載一個頁面。如果賬戶類型x包含y?
有人能告訴我我做錯了什麼嗎?
我profile.php
頁:
<?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'];
}
?>
<?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");
}
?>
<script type="text/javascript" src="assets/js/jquery.prettyPhoto.js"></script>
<?php include('includes/footer.php');?>
我定義的函數代碼:
// 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;
}