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 7542239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:06:51+00:00 2026-05-30T08:06:51+00:00

for some of my php pages, i use the $_SESSION to determine if a

  • 0

for some of my php pages, i use the $_SESSION to determine if a user is signed in, the code is:

if(isset($_SESSION['USERID'])&&$_SESSION['USERID']>=0&&is_numeric($_SESSION['USERID']));

for whatever reason, this if statement is being ignored, I have tested the $_SESSION to make sure that the value is empty by trying

$session=$_SESSION['USERID']; echo"$session"; the result is blank.

now at the end of php file i want to use an else follow the closing if bracket, this is creating the error of:

Parse error: syntax error, unexpected T_ELSE 

This is extremely frustrating, why would this occur?

  • 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-05-30T08:06:52+00:00Added an answer on May 30, 2026 at 8:06 am

    You’ve got a semicolon after your if. Take it out, and it won’t be ignored, plus your else will work.

    if(isset($_SESSION['USERID'])
       && $_SESSION['USERID'] >= 0
       && is_numeric($_SESSION['USERID']));
    #-------------------------------------^ shouldn't be here.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some pages are showing the phpinfo() output (in HTML so not php -i )
I have a PHP page and I want to share some data between pages
I have a php page and i have some javascript code to have a
I have the following pages: page1.php, page2.php and page3.php. Code in each of them
I want my PHP pages to be cached. To allow cache I use: session_cache_limiter('private');
I've got a bit of a dilemma with some PHP code. The site I'm
The pagination script I use doesn't display the posts for some reason. It displays
/one_path/some_page.php?var1=value1&var2=value2&var3=value3 Suppose I'm given something like the above. Not just the query variable string,
I've a php page with some forms used to upload images. Each form upload
I just created a PHP page that spits outs some data from my database

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.