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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:57:11+00:00 2026-05-31T23:57:11+00:00

This my code, and it is giving me an unexpected $end error and I

  • 0

This my code, and it is giving me an unexpected $end error and I cant seem to figure out why it is.

I thought it could have been because of the included files, but I get the same error running the code keeping the require files lines commented.
It says the error is on the last line.

<?php

//mysql and functions


require ("dbconnect.php");
require ("functions.php");

//start session
session_start();
//authenticate session - PART I
if (!isset($_SESSION['email']))
{
    echo "Please login.. Redirecting";
    header("refresh:2;url=login.php");
    die();
}
else
{
    //session data
    $email = $_SESSION['email'];
    $firstname = $_SESSION['firstname'];
    $lastname = $_SESSION['lastname'];
    //check session data in database for second authentication
    $check = mysql_query("SELECT * FROM users WHERE email='$email' AND 
        firstname='$firstname' AND lastname='$lastname'") or die(mysql_error());
    if(is_resource($check) and mysql_num_rows($check)>0)
    {
        //success
    }
    else
    {
        echo "Session Expired. Login Again.";
        header("refresh:2;url=login.php");
        die();
    }
    echo "Hi, This is protected content that is only for logged in members.";
?>
  • 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-31T23:57:13+00:00Added an answer on May 31, 2026 at 11:57 pm

    In case it’s not visible from my earlier re-indentation, you’re missing a } at the end, concluding the else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code is giving me this error: The object cannot be deleted because it
This is code is giving an error(codeigniter code) Parse error: syntax error, unexpected T_OBJECT_OPERATOR
I have this code giving me the strange error message Uncaught TypeError: Cannot set
I have made this code for giving out +1 point, but it doesn't work
The following code keeps giving me this error Parse error: syntax error, unexpected T_VARIABLE
Can anyone tell me what's wrong with this code? It's giving me an error
I have this piece of code that is giving me trouble. I know all
I cannot understand why the code below is giving me this error in firebug
This code giving error in IE Internet Explorer Cannot Open the Internet Site Operation
This code giving me fits. Returns the error: The given ColumnName 'COURSENAME' does not

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.