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

  • Home
  • SEARCH
  • 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 9126933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:09:58+00:00 2026-06-17T07:09:58+00:00

Is $var==1 the proper syntax for testing whether $var has a value? I ask,

  • 0

Is $var==1 the proper syntax for testing whether $var has a value?

I ask, because I’m getting a failure on a simple conditional.

Here’s the code that seems to be failing:

if ($slcustom31==1) {$page="http://www.mydomain.com/members/page_Alpha.php";}

I assume that there’s something wrong with the syntax, $var==1 .

++++++++
Here’s the entire conditional, if that makes things clearer:

//condition 1
if ($slcustom31==1) {$page="http://www.mydomain.com/members/page_Alpha.php";} 

//condition2
elseif ($slcustom31!=1 AND $slcustom29!="") {$page="http://www.mydomain.com/members/".$slcustom29;}

//condition3
else {$page="http://www.mydomain.com/members/page_Beta.php";} 

sl_redirecttourl($page);

SPECIFIC SYMPTOM:
Script ignores condition1 and condition2, defaults to condition3.

++++
And if it helps, here’s the entire (short) script:

$groupswithaccess="somegroup";

require_once("../slpw/sitelokpw.php");
require_once("../slpw/sitelokapi.php"); //gets value being tested by conditional

if ($slcustom31==1) {$page="http://www.mydomain.com/members/page_Alpha.php";} 
elseif ($slcustom31!=1 AND $slcustom29!="") {$page="http://www.mydomain.com/members/".$slcustom29;}//not finished, but started
else {$page="http://www.mydomain.com/members/page_Beta.php";} 

sl_redirecttourl($page);

Can someone tell me what I should do differently?

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-17T07:09:59+00:00Added an answer on June 17, 2026 at 7:09 am
    if($var ==1){
    //returns true only if var is 1
    }
    
    if(isset($var)){
    //returns true if you currently have any value stored as the variable $var
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm searching for a proper way to clean my pointers. Here the example code:
var contextMenu = { isVisible : false, open : function() { //some code here
var selector = $(this); What is the proper code to change the custom attribute
var ref1 = new Firebase(http://gamma.firebase.com/myuser/123,456); ref1.set(123,456); var on1 = ref1.on(value, function(snapshot) { console.log(snapshot.val()); });
var search= document.getElementById('appMenu').value document.location.href= '${createLink(controller: 'application' , action:'ajaxAppSearch', params: ['query': search])}' The element appMenu
Just trying to figure out the proper syntax for making a POST to an
I have this bit of code: var has_logger = (window.console && window.console.log); if (has_logger)
Could someone help me with the proper syntax? Not sure how to write the
I have this code: var myWidget = $('#myWidget'); and calls like this elsewhere: myWidget.hide();
What is the proper syntax for declaring the loop-specific variable in a for /

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.