Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8643287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:59:49+00:00 2026-06-12T11:59:49+00:00

I am tying to add conditional logic for showing a page to logged in

  • 0

I am tying to add conditional logic for showing a page to logged in users. I have 2 conditions which do not allow them to see page but instead restricted content message. Only 1 has to be true

1) They are not the Author of a form
2) They do not have a custom field called “member”

if( $_GET['gform_post_id'] <= 0 || $user != $author ) {
//Then show restricted content message
}

The above code is working for the first condition. But I am not sure how to add the 2nd part. I guess it would be an elseif

I guess in theory I could duplicate the restricted message by doing something like this

if( $_GET['gform_post_id'] <= 0 || $user != $author ) {
//Then show restricted content message
} elseif {
if($memberstatus == 'member'){
//Then show restricted content message
}

The reason I do not think this si good solution is my “Restricte Content” is quite large as I write a page with Divs in HTML basically. So it looks a little clumsy in the code to duplicate this twice.

So my question is: Is there a way to write the conditions on the same line?

i.e.

IF Condition 1 OR Condition 2 {
//Then show restricted content message
}

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:59:51+00:00Added an answer on June 12, 2026 at 11:59 am

    What about this?

    if(($_GET['gform_post_id'] <= 0 || $user != $author) || $memberstatus == 'member' ) {
        //Then show restricted content message
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to add some more conditional logic to my edit action by
I am editing a template to try and add some conditional logic to my
I'm trying to add conditional logic to determine if there's one regex match for
I have a a conditional comment in my page to fix a double padding-top
I am using Oracle 11g client, with ODP.NET. I am trying to add conditional
I'm trying to add a conditional where only records that meet the condition are
I was trying to add conditional formats like this: If expression =($G5<>) then make
I am trying to add some logic to a wordpress template. I want to
Here's what I need to do. I have a Tournament model, which is connected
I'm trying to add some conditional open graph tags to my app, using current_page

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.