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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:34:51+00:00 2026-05-25T09:34:51+00:00

I have a username variable from WordPress, by including wp-config.php. If I use on

  • 0

I have a username variable from WordPress, by including wp-config.php. If I use on my index page, I can run following and all is ok.

echo 'Username: ' . $current_user->user_login . "\n";

also I can call echo $_SESSION['username']; which both output the username.

I have an extended class that I am trying to pass this variable into. And I cannot seem to get it to work.

class elFinderVolumeMySQL extends elFinderVolumeDriver {

Does anyone please know how to do this. I have tried absolutely everything, but I am new to php and not well up on constructors extended classes and whether I am doing something really wrong here, which may cause me problems.

Any advice greatly apreciated.

ie I need to add to this to get all ids where equal to username.

protected function _scandir($id) {
        $files = array();
        $sql   = 'SELECT f.id, f.parent_id, f.name, f.size, f.mtime, f.mime, f.width, f.height, ch.id AS dirs 
                FROM '.$this->tbf.' AS f 
                LEFT JOIN '.$this->tbf.' AS ch ON ch.parent_id=f.id 
                WHERE f.parent_id="'.$id.'"
                GROUP BY f.id';

        if ($res = $this->query($sql)) {
            while ($r = $res->fetch_assoc()) {
                $id = $r['id'];

                $this->stat($id, false, $r);
                $files[] = $id;
            }
        }

        return $files;
    }
  • 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-25T09:34:51+00:00Added an answer on May 25, 2026 at 9:34 am

    $_SESSION is global by nature and is available across the script if following conditions are met:

    1. You are using session_start()
    2. You are not destroying sessions anywhere before trying to access them

    Thus, if you are not able to access the value using $_SESSION[‘username’], then do check for the two conditions shared above. You can also check the destroying of session by creating a test variable under sessions and see if its value is available or not.

    Hope this helps.

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

Sidebar

Related Questions

Static variable gotcha in php I am from Java background and have switched to
I have the following code which I got from http://css-tricks.com/startstop-slider/ I have it all
here's what i'm trying to do. I have a variable coming from a PHP
I have a sign-in-action-form page which accept username and password from sign-in-form. Now most
I have created a page called profile.php that gets a value from mainpage.php, by
I have the following code to pass variable from example1.html to example2.html , what
How to get user roles from Membership provider? Suppose I have a username and
i have the following form item { fieldLabel:'Username' ,id:username ,name:'username' ,allowBlank:false ,plugins:[Ext.ux.plugins.RemoteValidator] ,rvOptions: {
I have a login form that has Username and password as inputs from user
I have two foreach statements. The variable from one one is somehow getting into

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.