Jump to content

Here's a bit of php that isn't working... any ideas?


leleegrrl

Recommended Posts

This is the scripting for a page of protected content in my website. I have two kinds of membership... free and paid. Account ID for the free members is "1" and account ID for the paid members is "2".

 

As the script is below, it's still letting both 1 and 2 into the protected content, as long as they're logged in.

 

Note... it's just a problem with this particular bit of code on this particular page. The rest of the script is differentiating between account ID's 1 and 2 just fine. I bought the script and they do have a support email, but no active forum and it takes a long time to get any response from them.

 

Can anyone take a look and tell me what they think I should change? Do I need to put some 1's and 2's in there somewhere? I've tried a few things and nothing works... it's driving me bananas.

 

Thanks so much!

LoraLee

 

<?php

/**

* @file: protected_content_example.php

* @description: protected content page example

*/

session_start();

include_once "db_config.php";

include_once "classes/system.php";

include_once "classes/account.php";

include_once "classes/account_type.php";

include_once "classes/tools.php";

 

$account = new account($system);

$acount_type = new account_type($system);

$account_type_id = $account->get_account_type_id();

$account_type_title = $acount_type->get_account_type_title($account_type_id);

 

if ($account->check_login() == false) {

// redirect to index page if user not loged in

header("Location:index.php");

}

 

?>

Edited by leleegrrl
Link to comment
Share on other sites

Found the solution...

 

Replaced

 

if ($account->check_login() == false) {

 

with

 

if (($account->check_login() == false) || ($account_type_id != 2)) {

 

Just thought I'd post the solution in case anyone ever reads this thread and is wondering...

 

LLG

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...